Recoilize icon indicating copy to clipboard operation
Recoilize copied to clipboard

fix: recoilizeRoot error in react 18

Open boenfu opened this issue 2 years ago • 13 comments

Types of changes

  • [x] Bugfix (change which fixes an issue)
  • [ ] New feature (change which adds functionality)
  • [ ] Refactor (change which changes the codebase without affecting its external behavior)
  • [ ] Non-breaking change (fix or feature that would causes existing functionality to work as expected)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Purpose

React 18 can use

Approach

change find source root fiber method

Resources

{
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "recoil": "^0.7.3",
}

Screenshot(s)

it's work.

image

boenfu avatar Jun 27 '22 12:06 boenfu

This is working as expected

sunel-pyt avatar Aug 11 '22 08:08 sunel-pyt

Any progress?

tienne avatar Aug 24 '22 06:08 tienne

Would like to try this if this is merged

vip30 avatar Aug 25 '22 09:08 vip30

Can we merge this? I am not able to use recolize until this is fixed.

mwitteveen avatar Aug 26 '22 10:08 mwitteveen

Same issue with Recoilize:3.1.6 and React 18.2.0. we need any progress of this work

kjmin-dev avatar Aug 30 '22 04:08 kjmin-dev

Any update on this?

MatejFacko avatar Sep 02 '22 06:09 MatejFacko

Is this PR ready to merge?

dsvgit avatar Sep 21 '22 00:09 dsvgit

This is such a bummer, the inability to use with React 18 makes this library useless.

suzdalnitski avatar Sep 25 '22 16:09 suzdalnitski

Any update on this?

prescottprue avatar Oct 06 '22 16:10 prescottprue

Please, god

stelladraco27 avatar Oct 07 '22 06:10 stelladraco27

Is this good to go, if so could this be merged?

andyWynyard avatar Oct 11 '22 10:10 andyWynyard

This can be merged. If you need this patch ASAP you can patch the module locally, I got tired of waiting and did that. If people are interested I can post a short tutorial here.

stelladraco27 avatar Oct 12 '22 00:10 stelladraco27

@stelladraco27 please do, many would find this extremely helpful!

suzdalnitski avatar Oct 12 '22 00:10 suzdalnitski

Sorry for the wait on my solution as we wait for this to be merged, here it is!

Step 1) Make sure recoilize is installed! If you were lucky to get the module installed before this issue arose, you are good for the next step! If you are stuck with errors trying to install recoilize use the command npm install recoilize --force.

Step 2) Install patch-package and edit your package.json This package will allow you to patch the fix in this pull request instead of waiting for the owner of recoilize. Install the package with npm install patch-package. You could go into your node modules, find recoilize, and fix the problem there, but none of your changes would persist, thats why we need this package. Make sure you add "postinstall": "patch-package" to your package.json file in the "scripts" area.

Step 3) Edit the node module before you patch it Go to /node-modules/recoilize in your project and make the changes this pull request makes to the module. I looked at the change log and made the changes they did, but I think you can just override the original file with the file from the pr, all that matters is that the changes are made.

Step 4) Patch the module! Now that the changes are made you should be able to simply run the command npx patch-package recoilize.

Step 5) You should be good to go!

stelladraco27 avatar Nov 18 '22 06:11 stelladraco27

trying to manually add the dependency by using the staging url, considering it seems to be merged, but end up getting the following error with nextjs:

./src/pages/_app.tsx:24:19
Module not found: Can't resolve 'recoilize'
  22 |     const RecoilizeDebugger = dynamic(
  23 |         () => {
> 24 |             return import('recoilize')
     |                   ^
  25 |         },
  26 |         { ssr: false }
  27 |     )

https://nextjs.org/docs/messages/module-not-found

no static analysis warnings, as i do use @types/recoilize

ended up doing what @stelladraco27 described and worked (with pnpm's patching), thank you

emregca avatar Jan 07 '23 00:01 emregca

Howdy 👋 Do you have any ETA when this will be released? Thank you.

svagi avatar Jan 09 '23 16:01 svagi

Sorry for the wait on my solution as we wait for this to be merged, here it is!

Step 1) Make sure recoilize is installed! If you were lucky to get the module installed before this issue arose, you are good for the next step! If you are stuck with errors trying to install recoilize use the command npm install recoilize --force.

Step 2) Install patch-package and edit your package.json This package will allow you to patch the fix in this pull request instead of waiting for the owner of recoilize. Install the package with npm install patch-package. You could go into your node modules, find recoilize, and fix the problem there, but none of your changes would persist, thats why we need this package. Make sure you add "postinstall": "patch-package" to your package.json file in the "scripts" area.

Step 3) Edit the node module before you patch it Go to /node-modules/recoilize in your project and make the changes this pull request makes to the module. I looked at the change log and made the changes they did, but I think you can just override the original file with the file from the pr, all that matters is that the changes are made.

Step 4) Patch the module! Now that the changes are made you should be able to simply run the command npx patch-package recoilize.

Step 5) You should be good to go!

Very cool @stelladraco27! @svagi I'm afraid it'll be up to the next Recoilize team to take a closer look. I took a look but honestly don't have the time to dig deeper. Even though I merged the PR, the staging branch was intentional so that prior instructions would not be affected. Once the next Recoilize team can make sure nothing breaks before merging into master, hopefully it'll be incorporated into the next release.

joey-ma avatar Jan 10 '23 00:01 joey-ma