drop support for React17
context
With nextJs 13 also requiring React18, it makes sense to follow suit. All new features are build on top of react18. This means we can also drop the useSyncExternalStore shim, which has caused troubles in the past with react-native and ESM, and also adds a bit of bundle size.
proposal
- set the required peer dependency of react to ">=18.2.0"
Late to the party, but this is disappointing to hear. We won't be able to switch to React 18 for quite some time so we'll be stuck on v4 for a while. I was looking forward to all of the v5 updates (especially regarding infinite queries) and I was hoping to make react-query standard across our microservices. Continuing to use v4 across our codebase and knowing it will all be tech debt to replace it with v5 is a bit disheartening.
We won't be able to switch to React 18 for quite some time
@parkm can you let me know why you won't be able to switch to react18? It's been out for over a year now. The updates in 18 are mostly non-breaking - the most issues we've had when upgrading were around the TypeScript changes. Arguably, the framework you're building your software with is your most important dependency. As more and more new hooks will come out (think use or useEffectEvent), I expect many libraries to draw the line here and follow suite. NextJs has done the same thing - you can only use next13 if you have react18 ...
At the moment it's due to Enzyme not supporting React 18 and we have a ton of tests that would need to be converted to react-testing-library. It's an unfortunate tech debt that we've inherited. Sounds like we've kicked that can far enough though and we should prioritize upgrading.