0

I have this part of code from semantic ui in reactjs:

<Table.Row className={bu.state.activeIndex === i ? "title Active": "title"}  index={i} onClick={(e) => {bu.Accordion(e, i)}}>

Now I want to set error on this table row:

<Table.Row error className={bu.state.activeIndex === i ? "title Active": "title"}  index={i} onClick={(e) => {bu.Accordion(e, i)}}>

It work fine, but I want to set error with condition:

<Table.Row {value.deleted === 1 ? 'error': null} className={bu.state.activeIndex === i ? "title Active": "title"}  index={i} onClick={(e) => {bu.Accordion(e, i)}}>

But it give me error:

Syntax error: Unexpected token, expected "..." (366:37)

How can I solve this?

1 Answer 1

3

You're putting 'error' as a string but it's a parameter of the Table Row. You have to set it to true or false.

<Table.Row 
  error={value.deleted === 1 ? true : false } 
  className={bu.state.activeIndex === i ? "title Active": "title"}  
  index={i} 
  onClick={(e) => {bu.Accordion(e, i)}}
>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.