October 2019
Intermediate to advanced
426 pages
11h 49m
English
Right now, our Context Hooks use the default value that is specified by the context, when no provider is defined. To be able to change the value, we need to define a provider.
Let's start defining the provider:
import { ThemeContext } from './contexts'
return ( <ThemeContext.Provider value={{ primaryColor: 'deepskyblue', secondaryColor: 'coral' }}> <div style={{ padding: 8 }}> <Header text="React Hooks Blog" /> ... <PostList posts={posts} /> </div> </ThemeContext.Provider> )
Our app should look exactly the same way as before, but now we are ...
Read now
Unlock full access