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

Fix measure in iOS Modal #2654

Merged
merged 1 commit into from
Nov 24, 2021
Merged

Fix measure in iOS Modal #2654

merged 1 commit into from
Nov 24, 2021

Conversation

piaskowyk
Copy link
Member

@piaskowyk piaskowyk commented Nov 24, 2021

Description

Before

if (rootView == nil || (![rootView isReactRootView])) {
  return <error>;
}

After

if (rootView == nil) {
  return <error>;
}

Why?

Native Modal on iOS is not attached to ReactRootView.

Why I can do it?

Because React does it the same! - react-native measure method

Repro

https://github.com/emilioschepis/reanimated-2-in-modal
https://snack.expo.dev/@piaskowyk/github.com-emilioschepis-reanimated-2-in-modal

Fixes #1973

@piaskowyk piaskowyk self-assigned this Nov 24, 2021
Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@piaskowyk
Copy link
Member Author

@emilioschepis could you check if it fixes your issue?

@emilioschepis
Copy link

I can confirm this seems to work well. Thank you @piaskowyk !

@piaskowyk
Copy link
Member Author

@emilioschepis Thanks!

@piaskowyk piaskowyk merged commit b8ad37c into master Nov 24, 2021
@piaskowyk piaskowyk deleted the @piaskowyk/measure-in-modal branch November 24, 2021 11:45
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

Successfully merging this pull request may close these issues.

Accordion created with Reanimated v2 does not work inside a Modal component
4 participants