| 48 | export const useTheme = () => useContext(ThemeContext) |
| 49 | |
| 50 | export const ThemeExample: Component = props => { |
| 51 | const [theme, {changeColor}] = useTheme() |
| 52 | |
| 53 | return ( |
| 54 | <> |
| 55 | <h1 |
| 56 | style={{ |
| 57 | color: theme.color, |
| 58 | }} |
| 59 | > |
| 60 | {theme.title} |
| 61 | </h1> |
| 62 | <input |
| 63 | type="color" |
| 64 | name="color" |
| 65 | value={theme.color} |
| 66 | onInput={e => changeColor(e.currentTarget.value)} |
| 67 | /> |
| 68 | <label for="color">Change color theme</label> |
| 69 | </> |
| 70 | ) |
| 71 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…