Recoilize
Recoilize copied to clipboard
Snapshot.getDeps_UNSTABLE has been removed in recoil 0.2.0
https://github.com/open-source-labs/Recoilize/blob/96db24bda5208b464907b2880e87b7b44299d65a/package/index.js#L59
Snapshot.getDeps_UNSTABLE has been removed in recoil 0.2.0. This API changed to Snapshot.getInfo_UNSTABLE().deps. Recoilize needs to be updated here to be compatible with the latest recoil 0.2.0 release.
Any workarounds for this issue ? :)
Same problem, any help please? 👍
@TheMadKow while waiting for the update, you can modify the index.js file by replacing :
nodes.forEach(node => { // const getDeps = [...snapshot.getDeps_UNSTABLE(node)]; const getDeps = [...snapshot.getInfo_UNSTABLE(node).deps]; nodeDeps[node.key] = getDeps.map(dep => dep.key); });
Thanks, @kevintap-idemia for the help ;)
@SammyHam Thanks for the solution! Could you create a pull request for that please ?
Done #140
It would be great to get this PR merged - we're having to manually update the index.js everytime we add recoilize, and it's getting a bit tiresome.
The work is already done, just needs merging. @razananisathar @nbargers is there anything further we can help with to push this along?
I suspect that this is not being merged due to backwards compat concerns. The PR would allow compatibility with recoil 0.2.0+, but would then break compatibility with older recoil releases (0.1.3), which is the current stated compatible/tested recoil release in the docs for the recoilize 2.0.1 release. Perhaps @SammyHam if you re-work your PR to allow backwards compat, this might be simpler to merge?
Thank you for the workaround!
Is this issue fixed? because I also tried to add this change in the index.js file and the chrome extension just crashed!
Is this issue fixed? because I also tried to add this change in the index.js file and the chrome extension just crashed!
I believe the PR which fixed this issue was merged (https://github.com/open-source-labs/Recoilize/pull/140), and it would be included inside the release of v3.0.0 if it comes in the near future as planned.
I'm getting another error after I updated the getDeps function:
Uncaught TypeError: Cannot read properties of undefined (reading '_internalRoot')
with the function:
const createDevToolDataObject = (filteredSnapshot, diff) => {
if (diff === undefined) {
return {
filteredSnapshot: filteredSnapshot,
componentAtomTree: formatFiberNodes(
recoilizeRoot._reactRootContainer._internalRoot.current,
),
};
} else {
return {
filteredSnapshot: filteredSnapshot,
componentAtomTree: formatFiberNodes(
recoilizeRoot._reactRootContainer._internalRoot.current,
),
indexDiff: diff,
};
}
};
Is this because I'm using React 18?
This is still an issue