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.

Use new Context API in React 16.3

See original GitHub issue

There’s a new render prop/children-as-function API for context that just came in React 16.3.0. The big thing that’s relevant to us: It works across shouldComponentUpdate boundaries without the need for subscriptions.

It will require some refactoring. And backward compatibility is going to be…interesting. We may have to drop backward compatibility to make the implementation clean. FWIW, React Router and React Redux is considering this too, so we’re not alone.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:18 (17 by maintainers)

github_iconTop GitHub Comments

18reactions
leMaikcommented, Apr 1, 2018

I would prefer dropping support for React < 16.3 in 1.0.0. People will hate us, but they’ll need to effectively rewrite their app anyway when they update. Also, React 16.x is very stable, API-wise, so upgrading from React 16.0 to 16.3 to 16.x should be easy.

Regarding the metrics of the package: Didn’t look at that, missing issues and 1.4 kB overhead are a pretty big no-go.

7reactions
oliviertassinaricommented, Apr 1, 2018

I would prefer dropping support for React < 16.3 in 1.0.0.

@leMaik We will at least drop React < 16.0 support between 1.0.0-beta.x and 1.0.0. It’s a matter of timing. If the react team release React 17.0 in one year from now, I think that we can wait Material-UI 2.0.0 otherwise, as you say.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React v16.3.0: New lifecycles and context API
Version 16.3 introduces a new context API that is more efficient and supports both static type checking and deep updates.
Read more >
New Context API in React 16.3.0 - Akash Verma - Medium
React 16.3.0 is out now and with this release React Team has released the much awaited new context API which is a complete...
Read more >
React Context API: What is it and How it works?
Context API is a (kind of) new feature added in version 16.3 of React that allows one to share state across the entire...
Read more >
Use new Context API in React 16.3 #5908 - GitHub
I have been toying with react-broadcast in my router so that I can mimic (sort of, the API isn't exactly the same) the...
Read more >
New Context API in React 16.3 by Eric Kim - YouTube
Eric Kim: https://github.com/bosung90.
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