MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / App

Class App

code/one-direction-data-flow/src/app.jsx:32–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30};
31
32class App extends React.Component {
33 constructor(props) {
34 super(props);
35
36 this.state = { value: Store.get() };
37 Store.subscribe(value => this.setState({ value }));
38 }
39 render() {
40 return (
41 <div>
42 <Switcher
43 value={ this.state.value }
44 onChange={ Store.set.bind(Store) } />
45 </div>
46 );
47 }
48};
49
50ReactDOM.render(<App />, document.querySelector('#container'));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected