Skip to content

Dynamic component

module Dynamic = [%styled
(~color, ~background) => {j|
color: $color;
background-color: $background;
|j}
];
ReactDOMRe.renderToElementWithId(
<Dynamic color="#EB5757" background="#516CF0">
{React.string("Hello!")}
</Dynamic>,
"app",
);

TODO: Explain supported cases TODO: Explain interpolation https://github.com/jbranchaud/til/blob/master/reason/string-interpolation-with-quoted-strings.md TODO: Explain limitations