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

Move all portaling logic into BottomSheet, remove from our own Dialog wrapper #5661

Merged
merged 12 commits into from
Oct 9, 2024

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented Oct 9, 2024

No description provided.

},
]}>
<View onLayout={this.updateLayout}>
<BottomSheetPortalProvider>{children}</BottomSheetPortalProvider>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the children get their own portal provider, so that any dialogs inside of here get put in the right place.

}

return (
<Portal>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whatever the closest portal is we'll wrap the native component with.

Copy link

github-actions bot commented Oct 9, 2024

Old size New size Diff
7.89 MB 7.89 MB 4.2 KB (0.05%)

@haileyok haileyok merged commit bbd17b6 into samuel/auto-portal Oct 9, 2024
6 checks passed
@haileyok haileyok deleted the hailey/auto-portal branch October 9, 2024 18:29
<View onLayout={this.updateLayout}>{children}</View>
</View>
</NativeView>
if (__DEV__ && !Portal) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

DEV-only throws are generally something to avoid because this significantly changes the code path in production. It means that if someone were to hit this in prod, they would see completely different behavior. So it would be hard to diagnose. In some cases, it can be worse than crashing — for example if it accidentally uncovers a bug that causes some bigger problems (like losing or misinterpreting user data). I don’t mean that this would happen here but we should take it as a rule to throw both in PROD and DEV when we do throw. Or it needs to change to be non-throwing.

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.

2 participants