Do you know about React’s new Context API?

Do you know about React’s new Context API?
Average rating: 0
(0 votes)

Syndicode likes to keep the community smart and up-to-date! Now we’d like to introduce you React’s new Context API! It’s currently unreleased but will be included in the next minor React release. The old context API will continue to work until the next major release, so everyone should have time to migrate. So, what to expect? 

The new React’s Context API will be no longer scary as its ancestors. At least, it is said so. What improvements and fixes will be maid in the new React’s context API?

  1. It will be ‘a million times’ more intuitive than the old context API
  2. It will have React.createContext which is passed the initial value. This returns an object with a Provider and a Consumer
  3. It will have the Provider component that is used higher in the tree and accepts a prop called value
  4. It will have the Consumer component is used anywhere below the provider in the tree and accepts a prop called “children” which must be a function that accepts the value and must return JSX
  5. Now you will be able to use utility functions/components like in regular JavaScript

If you want to read the full overview – follow the link!

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

*By submitting this form you agree with our Privacy Policy.

Mailing & Legal Address

Syndicode Inc. 340 S Lemon Ave #3299, Walnut CA, 91789, USA

Visiting & Headquarters address
Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
Email info@syndicode.com
Phone (+1) 9035021111