Theme controller icon switch is not working with condition on React ? #3089
Unanswered
lucasbaylon
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
I might be wrong here but i have the following react component :
And I call it like this:
<ThemeButton color={currentColor} handleClick={() => currentMode === "Light" ? setMode('Dark') : setMode('Light')} />
The change of theme is carried out very well, but the change of icon does not work. I have the impression that the problem occurs as soon as I use a condition in the function
I can do something like:
or
I'm probably wrong, but the problem seems to be related to using a condition. This works if I don't use a condition:
But I need a condition to know which mode to display
Thank You
Beta Was this translation helpful? Give feedback.
All reactions