Created
September 26, 2019 07:23
-
-
Save Jared-Dahlke/3830ea703ce46df1ed08b85dc9bb7355 to your computer and use it in GitHub Desktop.
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 store from '../MyStoreAndMore.js' | |
| class SecondScreen extends React.Component { | |
| constructor(props, context) { | |
| super(props, context); | |
| this.state = store.getState(); | |
| store.subscribe(()=>{ | |
| this.setState(store.getState()); | |
| }); | |
| } | |
| state={ | |
| AlertCount:null | |
| } | |
| componentDidMount(){ | |
| this.setState({AlertCount: store.getState().AlertCount}) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment