question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve React compatibility

See original GitHub issue

I 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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
egoistcommented, Mar 2, 2022

Unfortunately, solving the ReferenceError: React is not defined error only leads to the Unhandled Runtime Error and Error: Invalid hook call…

regarding this, I’d like to see a minimal repo so I can understand what’s going on

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found