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

Props are set as properties, not attributes #998

Open
kasperskei opened this issue Jan 6, 2025 · 0 comments
Open

Props are set as properties, not attributes #998

kasperskei opened this issue Jan 6, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@kasperskei
Copy link
Contributor

kasperskei commented Jan 6, 2025

What happened?

By default, props passed to the JSX factory are set as properties. Add attr: prefix to the name to set element attribute instead of property.
https://www.reatom.dev/package/jsx/#reference

TODO

  • Remove undocumented namespace prop:;
  • Props are set as properties, not attributes;
  • Update types to match Element typing;
  • Update documentation.

Example

Source code:

<input disabled/>

Expected result:

el.disabled = true

Actual result:

el.setAttribute('disabled', '')

Part

Package @reatom/jsx

Version

3.16.0

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant