const [action, setAction] = useState(true);
const sharedVal = useSharedValue(action ? 10 : 20)
useEffect(() => {
setTimeout(() => {
setAction(false)
}, 2000)
}, [])
In the above code, the value of shareVal
doesn't change the value of action
changes. What is the best way to update value of sharedVal
after the timeout
.