recoil-outside
There is a problem to update states on recoilJS outside of component. It is a package of React to set or get on RecoilJS from outside of a component. This package is going to help you to update states or get states from outside of a component.
Set-Up
npm
npm i react-dom recoil recoil-outside
yarn
yarn add react-dom recoil recoil-outside
How to use
recoiljs getting-started
1. Set recoil followRecoilOutside
same file with RecoilRoot
2. Add ; const App = { return <RecoilRoot> <RecoilOutside/> <Main /> </RecoilRoot> ;}; ;
promiseSetRecoil
or promiseGetRecoil
3 When You will set or get at outside of the component, You can import :example
const setTest = async await const getTest = async const value = await return value