const availableEffects = useRef( Object.values(allEffects).filter(all => !answEffect.current.includes(all.animalName)) )
The useRef() Hook isn’t just for DOM refs. The “ref” object is a generic container whose current property is mutable and can hold any value, similar to an instance property on a class.