Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Suspense when freeze false #30

Open
xotahal opened this issue Dec 6, 2022 · 1 comment
Open

Remove Suspense when freeze false #30

xotahal opened this issue Dec 6, 2022 · 1 comment

Comments

@xotahal
Copy link

xotahal commented Dec 6, 2022

More of a question than an issue I would say. Why do we need Suspense here https://github.com/software-mansion/react-freeze/blob/main/src/index.tsx#L39?

The react-freeze is used by react-navigation. I don't use the freeze option but my screens go to suspense in this library and render null. I believe there would be a way to propagate placeholder and display something, but I already have suspense in my app. I want that suspense to catch the promise.

I can submit a PR with something like this:

if (!freeze) {
  return <Fragment>{props.children}</Fragment>
}

I just wanted to validate first

@xotahal
Copy link
Author

xotahal commented Dec 6, 2022

Found this comment - software-mansion/react-native-screens#1538 (comment). Which I guess answers my question.

Anyway, I experience issues caused by this suspense. When I render a simple navigator with react-navigation:

<NavigatorContainer>
  <Stack.Navigator>
    <Stack.Screen component={Authorized} />
  </Stack.Navigator>
</NavigatorContainer>

And the Authorized goes to Suspense it will never get rendered on screen when using version of react-native-screens with react-freeze (if I use console.logs in the Authorized component it prints them). As soon as I switch to react-native-screens@3.8.0 everything works. (react-freeze was added in 3.9.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant