Source: reasonml/reason-react#230 (comment)
Workaround from @yawaramin , Posted by @alexfedoseev
<WithTestId id="foo"> <button className="primary" /> </WithTestId>
// Output: <button class="primary" data-test-id="foo" />
[@react.component] | |
let make = (~id: string, ~children) => | |
ReasonReact.cloneElement(children, ~props={"data-test-id": id}, [||]); |
Source: reasonml/reason-react#230 (comment)
Workaround from @yawaramin , Posted by @alexfedoseev
<WithTestId id="foo"> <button className="primary" /> </WithTestId>
// Output: <button class="primary" data-test-id="foo" />