Skip to content
Advertisement

Tag: use-ref

Custom use effect comparator : ReactJS

I am having a state variable that is defined as follows where done has the following structure I want to run the useffect when some changes are made to the done and also values array under each object. In my case, useEffect gets triggered when I remove/add an objects to the done. But not when some changes happen inside values

ref is null Typescript + NextJS

I need to call methods from a custom child component inside the parent component. But unfortunately the ref to the child component (called CanvasUI) is always null. I don’t understand why as it seems to me that I have implemented everything correctly. This is my parent component And this is the CanvasUI component CanvasRef Interface I left out unimportant code

Cannot assign to read only property ‘current’ in React useRef

i used react useRef in functional components to get link on html object and store it in Recoil atom. For example: But when my Parent component ummounts I get error: react-dom.development.js:20997 Uncaught TypeError: Cannot assign to read only property ‘current’ of object ‘#’ in file reac-dom.development.js I can’t imagine what’s the problem; Answer The issue here is that atoms are

Advertisement