Created
March 19, 2020 17:40
-
-
Save oshell/dd32d1a22b7ca059b9043e69a161b78a to your computer and use it in GitHub Desktop.
Initialize Reactn Global State
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { setGlobal } from 'reactn'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
// Set an initial global state directly: | |
setGlobal({ | |
cards: [], | |
disabled: false, | |
initial: 'values', | |
x: 1, | |
}); | |
ReactDOM.render(<App />, document.getElementById('root')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment