Skip to content
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

Components are always invisible when hidden property is used #118

Closed
tomivirkki opened this issue Jun 9, 2023 · 0 comments · Fixed by #171
Closed

Components are always invisible when hidden property is used #118

tomivirkki opened this issue Jun 9, 2023 · 0 comments · Fixed by #171
Assignees
Labels

Comments

@tomivirkki
Copy link
Member

tomivirkki commented Jun 9, 2023

Components can't be hidden with the hidden property because when the value changes to false, the attribute isn't removed but hidden="false" attribute gets added instead and the component stays hidden.

Steps to reproduce:

  1. Create a new Hilla React project with npx @hilla/cli init --react my-hilla-app
  2. In HelloReactView.tsx, add hidden={!name} to the <Button>
  3. Type into the field -> the button stays hidden

As a workaround, you need to wrap the component inside another element and add the hidden={!name} to it instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants