Quantcast
Channel: Recoil useRecoilValue outside component - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Konrad for Recoil useRecoilValue outside component

This should workconst ReactCom = () => { const json = useGetJson(); ....}const useGetJson= () => { let jsonFile = useRecoilValue(someAtom); return jsonFile;}

View Article



Recoil useRecoilValue outside component

I want to build a JSON file based on a bunch of recoil values, so I created a function that fetches all the recoilVaules and returns a JSON out of it, and I call it from a component.The thing is that...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images