-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show / not show component content #305
Comments
Probably a duplicate of #298. Try downgrading to <Button variant="contained" onClick={handleOpen}>{open ? 'Show' : 'Close'}</Button> Unrelated, but this probably is a bug. Signals are objects, and objects are truthy, so <Button variant="contained" onClick={handleOpen}>{open.value ? 'Close' : 'Show'</Button> I imagine you want the strings to be reversed too, showing 'Close' when the display is open, and 'Show' when it's hidden. |
Thank you very much for your answer. I really had an error of mine in the "... onClick={handleOpen}>{open ..." part. The correct way would be to use open.value, but it still has the same behavior. I downgraded it, but the behavior remained the same as with useState. Every component was rendered. Thanks |
That's correct, if you're using React. Only text nodes ( I'll close this out as a duplicate, but feel free to reply if you're still having issues. |
How do I change a "state" to show or not show component content?
Ex:
Thanks.
The text was updated successfully, but these errors were encountered: