On ReasonReact, if I want to render a specific element on a HTML element by id
I can use the built-in function renderToElementWithId(ReasonReact.reactElement, Dom.element)
, for example:
ReactDOMRe.renderToElementWithId(<MyComponent />, "myComponent");
I have multiple <input />
HTML tags, and I want it to be rendered in every <input />
which has a specific data attribute. More specifically, I want that each input
which has data-type="tags"
on it be rendered by <MyComponent />
. On Javascript we could do something like document.querySelectorAll("[data-type=tags]")
and iterate the result rendering the components.
Although, I can't find anywhere in the documentation of ReasonReact nor BSB about how to do this. Can someone help me?
Thanks, in advance.