-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
}, | ||
]}> | ||
<View onLayout={this.updateLayout}> | ||
<BottomSheetPortalProvider>{children}</BottomSheetPortalProvider> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
|
<View onLayout={this.updateLayout}>{children}</View> | ||
</View> | ||
</NativeView> | ||
if (__DEV__ && !Portal) { |
There was a problem hiding this comment.
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.
No description provided.