const [switch, setSwitch] = useState(false)
useEffect(() => {
...
getValueFromServer()
...
setSwitch(true)
}, [])
return (
<CustomSwitch
startOnLeft={switch}
/>
)
I changed switch to true when I got a true from getValueFromServer(), but CustomSwitch doesn't start on right side.
Should I have to use constant to startOnLeft?