MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / Content

Function Content

styled-components-test/src/App.tsx:9–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7 background: ${props => props.theme.dark ? 'black' : '#ccc'}
8`
9function Content() {
10 const theme = useTheme();
11 const [dark, setDark] = useState<boolean>(theme.dark);
12
13 return <>
14 <button onClick={() => setDark(!dark)}>切换</button>
15 <ThemeProvider theme={{ dark }}>
16 <Aaa></Aaa>
17 </ThemeProvider>
18 </>
19}
20
21function App() {
22 return <ThemeProvider theme={{ dark: true }}>

Callers

nothing calls this directly

Calls 1

useStateFunction · 0.90

Tested by

no test coverage detected