Skip to content

Conversation

@te-online
Copy link

Potentially fixes #6.

See discussion in #18.

This approach adds a parser property, which enables you to use the parser of your choice, when server-side-rendering.

parser – With this property you can pass in a custom parser, such as dom-parser. This enables you to do server-side-rendering.

Example
const parser = typeof document==='undefined' && require('dom-parser');
render(<Markup parser={parser} markup="<em>hello!</em><h1>asdflkj</h1>" />);

What do you think?

@danielweck
Copy link

danielweck commented Mar 30, 2021

Follow up: #6 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReferenceError: document is not defined. Server Side rendering does not seem to work.

2 participants