-
-
Notifications
You must be signed in to change notification settings - Fork 135
fix: use JSX.Element for type definitions #146
New issue
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
fix: use JSX.Element for type definitions #146
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yunyu Thanks for opening this PR! Overall, it looks good. I left some minor/nitpick comments. Let me know what you think.
49c8822
to
bae05c0
Compare
@remarkablemark I've made the requested changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for making the changes @yunyu!
I'll make a release later tonight Published 0.10.3: npm: npm i -S [email protected] yarn:
|
What is the motivation for this pull request?
This makes the library usable for non-React JSX implementations in TypeScript. JSX.Element is defined as React.ReactElement for the 'react' package, and is overridden by other JSX implementations. Fixes #145.
What is the current behavior?
Currently, trying to use html-react-parser with Preact in TS will result in a bunch of type errors.
What is the new behavior?
Checklist: