class App extends React.Component {
static contextType = [themeContext, userContext]
render() {
const [theme, user] = this.context
/* ... */
}
}
+1 :+1:
Whys is this closed? I have a use case like this.
Can anyone please suggest a solution if it exists.
I need it too. There are some ways to consume multiple contexts in functional component but not in class component.
Most helpful comment
Whys is this closed? I have a use case like this.
Can anyone please suggest a solution if it exists.