I want to set function in function’s arguments like this:
export const Mode = (mode, setMode) => {
mode == "dark" ? setMode("light") : setMode("dark")
}
and result was setMode is not a funtion
I want to set function in function’s arguments like this:
export const Mode = (mode, setMode) => {
mode == "dark" ? setMode("light") : setMode("dark")
}
and result was setMode is not a funtion
2
Answers
First you add this
hook
:And export function
Mode