nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 180 forks source link

MotiLink not working with App Router #466

Closed lolo-io closed 9 months ago

lolo-io commented 9 months ago

Is there an existing issue for this?

Do you want this issue prioritized?

Current Behavior

I am importing MotiLink from "solito/moti/app"

Whenever I add a component in one of my Client Component, I get this error :

Unhandled Runtime Error NotFoundError: Node.removeChild: The node to be removed is not a child of this node

Expected Behavior

Link should work

Steps To Reproduce

No response

Versions

- Solito: 4.2.1
- Next.js: 14.1.0
- Expo: error is on web
- React Native: 0.71.3

Screenshots

image

Reproduction

No response

nandorojo commented 9 months ago

There’s zero code here so I can’t help. Maybe you’re importing from the wrong place

nandorojo commented 9 months ago

The error points to safe area context, not solito or moti. What makes you think these are related exactly

lolo-io commented 9 months ago

What made me think that, was that when I removed MotiLink from my component, everything worked fine.

But I found a solution now. I am in the process of transitioning from next page router to app router and I am using React Native Paper for styling, I noticed that removing <PaperProvider/> led me to another error:"setImmediate is not defined".

I added import 'setimmediate' to my index.ts file where my providers are stacked, and kept <PaperProvider/> and everything works fine now.

Adding import 'setimmediate' to the layout file didn't work.

So for me if anyone encounters a similar problem try adding import 'setimmediate' to your index.ts file.