Improve React compatibility
See original GitHub issueI have seen multiple issues and blog posts on how to use tsup with react. Often, I see:
- the
--inject
option for react imports - adding the
--external react
option
Unfortunately, solving the ReferenceError: React is not defined
error only leads to the Unhandled Runtime Error
and Error: Invalid hook call.
.
I can’t seem to figure out how to use tsup with react. I’d love a workaround, though ideally tsup would support react without any configuration necessary.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to Upgrade to React 18
To help surface these issues, React 18 introduces a new development-only check to Strict Mode. This new check will automatically unmount and ...
Read more >21 Performance Optimization Techniques for React Apps
Optimize your React application's performance with these 21 techniques. ... Improving React and Redux performance with Reselect,
Read more >Browser Compatibility for ReactJS Web Apps
React supported browsers – Modern browsers such as Edge, Firefox, Chrome, and Safari are supported by React 18. Try Cross Browser Testing ...
Read more >Tips for improving React performance - Asap developers
React modifies the browser DOM using a browser-independent DOM system for performance and cross-browser compatibility, which means you can use ...
Read more >Methods Of Improving And Optimizing Performance In React ...
Analyzing React Components With Chrome's Performance Tab # · Disable all extensions temporarily, especially React Developer Tools, because they ...
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 FreeTop 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
Top GitHub Comments
regarding this, I’d like to see a minimal repo so I can understand what’s going on
Related https://github.com/egoist/tsup/issues/715#issuecomment-1279767224