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.

Requiring React 16

See original GitHub issue

I’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:closed
  • Created 4 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
epicfaacecommented, Sep 9, 2019

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)

1reaction
sbuschcommented, May 21, 2019

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:

  • original render renamed to renderWithContext
  • new render is just a wrapper that gets the context and calls renderWithContext with it
Read more comments on GitHub >

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

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