You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow arbitrary data-* attributes on DOM elements in JSX #152
This pattern is heavily used in modern design systems and utility-CSS ecosystems because it allows component state to be expressed declaratively and consumed by CSS.
Proposal
Allow arbitrary attributes matching the pattern:
data-*
on lowercase DOM elements in JSX without requiring them to be explicitly declared in JsxDOM.domProps.
This could be implemented as a special case in JSX attribute validation.
Benefits
better interoperability with the React ecosystem
easier migration of existing React / TypeScript codebases
simpler implementation of design systems
avoids the need for custom JSX infrastructure for a standard HTML feature
Expected developer experience
Developers should be able to write JSX like this without additional configuration:
<buttondata-state="open"data-variant="primary" />
In real-world usage these attributes often contain values coming from ReScript variables, component props, or state:
Activity