-
-
Notifications
You must be signed in to change notification settings - Fork 238
Update select.mdx docs to show on ios #402
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
base: main
Are you sure you want to change the base?
Conversation
the previous example was not showing how the select function would work on IOS with this update it shows the IOS option
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe Select component example was updated to support iOS-specific portal rendering. New imports were added, and the Example function now conditionally wraps the Select dropdown in a FullWindowOverlay with a PortalHost on iOS. Additional props are passed to SelectContent only for iOS platforms. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ExampleComponent
participant Select
participant SelectContent
participant FullWindowOverlay
participant PortalHost
User->>ExampleComponent: Render Example
ExampleComponent->>Select: Render Select
Select->>SelectContent: Render SelectContent
alt Platform is iOS
ExampleComponent->>FullWindowOverlay: Render Overlay
FullWindowOverlay->>PortalHost: Render PortalHost (IOS_PORTAL_HOST_NAME)
SelectContent->>PortalHost: Use portalHost prop
end
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/docs/src/content/docs/components/select.mdx (2)
77-80
: Remove the unusedView
import to avoid dead code in the snippet.
View
is imported but never referenced in the example. Keeping unused imports may confuse readers, and if someone blindly copies the snippet into a TypeScript-strict project it will trigger an eslint / tsc error.-import { Platform, View } from 'react-native'; +import { Platform } from 'react-native';
126-130
: Document the minimum version requirement forFullWindowOverlay
.
FullWindowOverlay
is available only inreact-native-screens >= 3.20
(and iOS 13+).
Readers on older versions will hit a runtime error when copying the snippet. Add a short comment or version note right above the import to save them the headache.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/docs/src/content/docs/components/select.mdx
(1 hunks)
🔇 Additional comments (1)
apps/docs/src/content/docs/components/select.mdx (1)
100-105
: Guard againstundefined
values fromPlatform.select
for non-iOS targets.
Platform.select
returnsundefined
on Android / Web, which is fine, but some strict prop typings might not acceptundefined
.
IfSelectContent
’sportalHost
andsideOffset
expect a concrete value, add an explicit fallback to keep the example universally type-safe:-portalHost={Platform.select({ ios: IOS_PORTAL_HOST_NAME })} -sideOffset={Platform.select({ ios: 16 })} +portalHost={Platform.select({ ios: IOS_PORTAL_HOST_NAME }) ?? undefined} +sideOffset={Platform.select({ ios: 16 }) ?? 0}
Description:
the previous example was not showing how the select function would work on IOS with this update it shows the IOS option
Fixes issue #
Tested Platforms:
Summary by CodeRabbit