Closed Simounet closed 4 years ago
Hey @Simounet,
you should now be able to pass a className
prop (and more) on the final component.
See https://github.com/prismicio/prismic-reactjs/pull/41
Note that if you need to do this on children components, you will need to rely on htmlSerializer
prop. See this: https://prismic.io/docs/javascript/beyond-the-api/html-serializer
Let me know if I can help further, Hugo
Wanted to add another thought here. Currently it's not possible to add custom props to RichText
and then access those in the htmlSerializer
. Instead, the props get put on the Component
which is a Fragment
by default.
Is there a way to actually get those props to pass them down to children in htmlSerializer
?
Hi there, Maybe I didn't saw the option to give props (like
className
) to the the final component. My use case is styling components with styled-jsx, I need to set theclassName
prop on the final component that will be styled. Have a nice day.