Add a defaultValue for context example

This commit is contained in:
Dan Abramov
2018-04-18 17:23:12 +01:00
committed by GitHub
parent a4aa51035a
commit e32847f030

View File

@@ -2,7 +2,9 @@
const ThemeContext = React.createContext('light');
// Signed-in user context
const UserContext = React.createContext();
const UserContext = React.createContext({
name: 'Guest'
});
class App extends React.Component {
render() {