Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: __WEBPACK_IMPORTED_MODULE_0_react___default.a.createContext is not a function #24

Closed
Ashwini-Kadam opened this issue Nov 20, 2018 · 1 comment

Comments

@Ashwini-Kadam
Copy link

commented Nov 20, 2018

I want to used context with two component, created context in parent as 馃憤
export const settingContext = React.createContext(null);
created context and use that context with settingValue which is true, ProviderInfo is component
<settingContext.Provider value={settingValue}>

</settingContext.Provider>
I have setstate the settingValue to true.
And in ProviderInfo component use it like :
<settingContext.Consumer>
{this.props.settingValue? :''}
</settingContext.Consumer>
But I'm getting this kind of error.

@karthikvt26

This comment has been minimized.

Copy link
Collaborator

commented Nov 20, 2018

@Ashwini-Kadam looks like this has to do with the React version installed. It is available only with React versions > 16.3.

Checkout this out for more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.