()
| 7 | background: ${props => props.theme.dark ? 'black' : '#ccc'} |
| 8 | ` |
| 9 | function 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 | |
| 21 | function App() { |
| 22 | return <ThemeProvider theme={{ dark: true }}> |
nothing calls this directly
no test coverage detected