Browse Source
* added context default value example * Implement suggested change * noop function as default value to createContextmain
tjallingt
7 years ago
committed by
Alex Krolick
2 changed files with 11 additions and 0 deletions
@ -0,0 +1,8 @@ |
|||
// highlight-range{1-2}
|
|||
// Make sure the shape of the default value passed to
|
|||
// createContext matches the shape that the consumers expect!
|
|||
// highlight-range{2-3}
|
|||
export const ThemeContext = React.createContext({ |
|||
theme: themes.dark, |
|||
toggleTheme: () => {}, |
|||
}); |
Loading…
Reference in new issue