Error occurs when using React third-party component library
I want to use react-phone-number-input component in my project, but it gives error when I incorporate the component in my code. Picture 1 is the error it gives in browser and picture 2 is the error it gives in terminal. I wonder if anyone knows what's going on here or knows how to properly include third-party component library in the project?
I created a small project to reproduce the error I got just for referrence: https://github.com/MingdaMa/fresh-react-third-party-library
GitHub
GitHub - MingdaMa/fresh-react-third-party-library
Contribute to MingdaMa/fresh-react-third-party-library development by creating an account on GitHub.
1 Reply
The error occurs when Preact and React are mixed together. JSX nodes need to go through Preact for Preact to render them. Make sure you're setting up the react to preact/compat aliasing properly. Here is an example of what it should look like:
https://github.com/denoland/fresh/issues/1491#issuecomment-1643407629