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
Currently, there's no way to pass data-* into an element, while React allows it. There's currently a workaround where avoiding JSX transformations you can pass an object with the key being data-watever.
This makes it a little hard to create components that might rely on external from your react code, such as Analytics, error reporting and integration with older frontend systems.
The idea is to have a special case where data_what or dataWhat (or literally whatever we want, didn't think deeply about any edge case) gets transformed into data-what as an attribute on the DOM element.
The text was updated successfully, but these errors were encountered:
I think trying to do something more sophisticated at library or ppx might be too hard to maintain (when compared to the benefits), and the DX of calling createDOMElementVariadic is not that bad.
Right, the approach I'm proposing seems too magic compared with createDOMElementVariadic. But I don't see the solution to attributes called (data-) that need to be attached to dom elements. In JSX (React 16) you can attach any data- prop into any component and will be placed in the DOM as an attribute.
This issue aims to reflect the same behaviour as JSX but adds a few constraints since we can't use - for labelled arguments. I assume we wanted to make it work for all components but maybe that isn't the case.
Currently, there's no way to pass
data-*
into an element, while React allows it. There's currently a workaround where avoiding JSX transformations you can pass an object with the key beingdata-watever
.This makes it a little hard to create components that might rely on external from your react code, such as Analytics, error reporting and integration with older frontend systems.
The idea is to have a special case where
data_what
ordataWhat
(or literally whatever we want, didn't think deeply about any edge case) gets transformed intodata-what
as an attribute on the DOM element.The text was updated successfully, but these errors were encountered: