Components
compile
Compile a React component to a string with the Onedoc print styles.
compile
Support
Client-side
Server-side
Examples
Emotion CSS
Pass { emotion: true }
as the second compile option to merge and extract critical CSS using Emotion. Some libraries such as Chakra UI require this option to work correctly.
const html = await compile(<Component />, { emotion: true });