MCPcopy
hub / github.com/facebook/react / AboutPage

Function AboutPage

fixtures/nesting/src/modern/AboutPage.js:11–27  ·  view source on GitHub ↗
({counter, dispatch})

Source from the content-addressed store, hash-verified

9const Greeting = lazyLegacyRoot(() => import('../legacy/Greeting'));
10
11function AboutPage({counter, dispatch}) {
12 const theme = useContext(ThemeContext);
13 return (
14 <>
15 <h2>src/modern/AboutPage.js</h2>
16 <h3 style={{color: theme}}>
17 This component is rendered by the outer React ({React.version}).
18 </h3>
19 <Greeting />
20 <br />
21 <p>
22 Counter: {counter}{' '}
23 <button onClick={() => dispatch({type: 'increment'})}>+</button>
24 </p>
25 </>
26 );
27}
28
29function mapStateToProps(state) {
30 return {counter: state};

Callers

nothing calls this directly

Calls 2

useContextFunction · 0.90
dispatchFunction · 0.50

Tested by

no test coverage detected