kentcdodds / advanced-react-patterns-v2

Created with CodeSandbox
https://codesandbox.io/s/github/kentcdodds/advanced-react-patterns-v2
1.51k stars 568 forks source link

Component with React.createContext() used in older version of react #41

Closed adyz closed 6 years ago

adyz commented 6 years ago

Hey Kent,

Awesome workshop!

I am building a similar component using React.createContext(), but I want use the component in an older project that uses react 16.0.0 and errors on createContext because this was introduced later.

Is there any recommended way to polyfill this?

Thank you!

kentcdodds commented 6 years ago

I recommend https://npmjs.com/package/create-react-context :+1:

I'm glad you like the workshop!