import React from 'react' import { ThemeContext, themes } from '../../contexts/ThemeContext' import Toggle from '../toggle/index' const Root = () => ( {({ theme, setTheme }) => ( { if (theme === themes.light) setTheme(themes.dark) if (theme === themes.dark) setTheme(themes.light) }} value={theme === themes.dark} /> )} ) export default Root