Closed igsys closed 4 years ago
The hooks write with react-dom
, https://github.com/facebookexperimental/Recoil/blob/master/src/hooks/Recoil_Hooks.js#L24
That means the library didn't support react-native
yet
hm. I somehow have this error in a web app, not react-native.
in my case the selector fails on get(manuscriptAtom);
export const journalNameAtom = selector({
key: 'journalName',
get({ get }) {
const manuscript: Manuscript = get(manuscriptAtom);
return manuscript?.journal?.name ?? '';
},
});
tried to get rid of
alias: {
'react-dom': '@hot-loader/react-dom',
},
from webpack config and still nothing. Using version 0.0.7
same error here in react-native... i wonder how difficult is it to implement in react native
I'm thinking if somehow we can replace the usage of react-dom
with react-reconciler
, we can use recoil with react-native projects. I've looked at it a little, but it doesn't seem like a simple replacement that can be done with codemod. I'd have to look into it further.
Yeah I have that same problem on one my phone s
I'll have to look into it I can revoke it butt Im not sure if you want that
It's working for me when I link it locally and build it without terser (minification). Here's my Expo project if anyone wants to see how to get linking working: https://github.com/jacques-blom/recoil-test-expo
Check out the Readme for setup instructions.
Looking into why terser is causing this.
Here's a PR that aims to fix this: https://github.com/facebookexperimental/Recoil/pull/69
Thanks for reporting and for the fix!
Nice library! I am using this in an Expo project (SDK37), it gives me _readOnlyError. I thought I did something wrong with my code, and used the example from document, and output the same errors when I use 'selector' as an argument in useRecoilState. Notice, 'atom' does not throw errors, working fine.
Any solution to this?
Error