Requiring React 16
See original GitHub issueI’m working on a PR on react-jsonschema-form
for passing an Ajv instance from outside (allowing custom keywords etc.), and I need to use the Context API which has been introduced in React 16.3.
Even better would be availability of contextType
for React class components, introduced in React 16.6.
Would you accept a PR which bumps up React version to 16.3, 16.6 or even current 16.8.6? and peerDependency to >= 16.3 or >= 16.6, respectively?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
React v16.0 – React Blog
We're excited to announce the release of React v16.0! Among the changes are some long-standing feature requests, including fragments, ...
Read more >pnpm install fails due to @mdx-js/runtime requiring React 16
It seems some deep dependency of Docusaurus has a strict React 16 requirement: ERR_PNPM_INVALID_PEER_DEPENDENCY ..\..\packages\cloudvision-docs ...
Read more >React 16 - Mobify DevCenter
There are a lot of big changes with React 16 that require you to upgrade certain packages as well as your code in...
Read more >Working with React 16.x · Enzyme - GitHub Pages
npm i --save-dev enzyme enzyme-adapter-react-16. And then you're ready to go! In your test files you can simply require or import enzyme:.
Read more >React 16 performance: React 16, Next.js and Node 8.x LTS
React 15 vs React 16 ... Some of these key improvements are: ... react is 5.3 kb (2.2 kb gzipped), down from 20.7...
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
I’ve updated the peer dependency to 16, but would it be better to make it 16.3 or 16.6 as you suggested? I’m not sure if doing so would cause issues with upgrading (because not everyone may be on newer versions of React 16)
Closed (for now) #1286 I use the ponyfill mentioned above. Due to the lack of contextType support, the code is slightly more verbose than necessary, but I managed to restrict the changes in this regard, see
render/renderWithContext
wrapper for class-based components:render
renamed torenderWithContext
render
is just a wrapper that gets the context and callsrenderWithContext
with it