wow, first time I come across this expression: <>{ condition ? children : null }. What's its name? Thanks.
<>{ condition ? children : null }
Ternaty operator When you put it inside a React fragment, you ensure that the function will always return JSX.
ah, I think, it should be: <>{ condition ? children : null }</>
<>{ condition ? children : null }</>
Or, the closing </> is optional? Thanks.
</>
Yeah, you should close it. I'd review my code snippets again next time.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
wow, first time I come across this expression:
<>{ condition ? children : null }
. What's its name? Thanks.Ternaty operator
When you put it inside a React fragment, you ensure that the function will always return JSX.
ah, I think, it should be:
<>{ condition ? children : null }</>
Or, the closing
</>
is optional? Thanks.Yeah, you should close it. I'd review my code snippets again next time.