Skip to content
loading...

re: Binding external components with ARIA properties in ReasonReact VIEW POST

FULL DISCUSSION
 

There's a neat little trick you can do to make a 'spread' component that just injects the given props objects into its child:


module Spread = {
  [@react.component]
  let make = (~props, ~children) =>
    ReasonReact.cloneElement(children, ~props, [||]);
};
...
<Spread props={"data-testid": "foo"}>
  <div />
</Spread>
 
code of conduct - report abuse