Error when trying to create a React wrapper for the library
See original GitHub issueHi, I found your library and I think it’s really cool! I’m trying to add it to a React project and I keep getting an error that Object(…) is not a function when calling the annotate function.
I reproduced the behavior in a code sandbox.
https://codesandbox.io/s/tender-river-k6d32?fontsize=14&hidenavigation=1&theme=dark
Idk what I’m doing wrong.
Thank you so much!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Wrapping MUI with my library returns error - Stack Overflow
Try to delete reactjs in your node_modules, and run: npm install, then restart server this will use the component in your library.
Read more >Error Boundaries - React
Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI ......
Read more >How To Create Wrapper Components in React with Props
Wrapper components are components that surround unknown components and provide a default structure to display the child components.
Read more >How to Create and Publish a React Component Library
This tutorial will take you through the process of creating and publishing your own custom React component library and hosting it on Github....
Read more >Common mistakes with React Testing Library - Kent C. Dodds
Some mistakes I frequently see people making with React Testing Library. ... The return value from render is not "wrapping" anything.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Seems like your project/webpack settings are not picking up the ‘main’ file from the package.json.
Try doing this instead:
However, it does cause the typing and intellisense suggestions to no longer function as expected.