I want to be able to return true into a const
if another const
is inequal to null.
Everything that I have tried on crashing react.
Most Promising:
const isActive = plugVal !== null
this keeps returning true even when plugVal
is null.
With useState hook I tried:
const [isActive, setIsActive] = useState(false)
if(plugVal){
setIsActive(true)
}
else{
setIsActive(false)
}
this triggers to many re-renders