We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The README shows:
const HtmlToReactParser = require('html-to-react').Parser; const htmlInput = '<div><h1>Title</h1><p>A paragraph</p></div>'; const htmlToReactParser = new HtmlToReactParser(); const reactElement = htmlToReactParser.parse(htmlInput);
However, when trying to follow the above I got type errors saying Parser is a function and couldn't be used with new.
Parser
new
This seems to work:
import { Parser } from "html-to-react"; const htmlInput = '<div><h1>Title</h1><p>A paragraph</p></div>'; const htmlToReactParser = Parser(); const reactDescription = htmlToReactParser.parse(htmlInput);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The README shows:
However, when trying to follow the above I got type errors saying
Parser
is a function and couldn't be used withnew
.This seems to work:
The text was updated successfully, but these errors were encountered: