Created
April 26, 2020 14:40
-
-
Save vman/e7bad70d054b8533f39e96ef4ed06768 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [styleState, setStyleState] = useState<string>(styles.containerdefault); | |
//Run anytime the themeState changes. | |
useEffect(() => { | |
console.log("themeState useEffect fired"); | |
switch (themeState) { | |
case "dark": | |
setStyleState(styles.containerdark); | |
break; | |
default: | |
setStyleState(styles.containerdefault); | |
} | |
}, [themeState]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment