Type 'boolean' is not assignable to type 'CollectionElement<object>'.ts(2322) #2137
Answered
by
ayanonline
ayanonline
asked this question in
Help
-
how can I solve this errorERROR: Type 'false | Element' is not assignable to type 'CollectionElement'.Type 'boolean' is not assignable to type 'CollectionElement'.ts(2322) |
Beta Was this translation helpful? Give feedback.
Answered by
ayanonline
Jul 14, 2024
Replies: 2 comments 3 replies
-
Please let me know if you found a solution for this. I am looking for the same. |
Beta Was this translation helpful? Give feedback.
2 replies
-
If you are using collection-based component, you can't do in this way since empty / null children inside is not allowed. What you can do is add a hidden |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
simply add hidden prop with you condition
<DropdownItem
hidden={!isLoggedIn }
key="logout"
textValue="Logout"
onClick={logoutHandler}
>
Logout