i used react useRef in functional components to get link on html object and store it in Recoil atom. For example:
const Children = () => {
const [refLink, setSrefLink] = useRecoilState(refLink)
return <input ref={someRef}/>
}
const Parent = () => {
const [refLink, setSrefLink] = useRecoilState(refLink)
const someRef = useRef();
setSomeRef(someRef)
return <Children />;
}
export const refLink = atom({
key: 'refLink',
default: null ,
});
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;
