recoil-observer
A simple recoil dev tool to observe the state changes.
- log the state once changed.
- post message to other dev tool like a chrome-extension.
- optional to do nothing in production environment.
1. install
yarn add recoil-observer
with
yarn add recoil
2. usage
import { RecoilObserver } from 'recoil-observer';
return (
<RecoilRoot>
<RecoilObserver />
...
</RecoilRoot>
);
3. API
props | description | default value | type |
---|
checkInitState | whether check the default state or not | true | boolean |
log | console.log the state KV | true | boolean |
useDevTools | post the message to other devTools | false | boolean |