-
-
Notifications
You must be signed in to change notification settings - Fork 39
Fix: Align PositionedContentProps style with Pressable style prop #94
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
Components using PositionedContentProps are only typed to receive a single style object even though they actually work with arrays of style objects too
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe type of the Changes
Sequence Diagram(s)sequenceDiagram
participant Consumer as Component Consumer
participant PositionedContent as PositionedContent Component
Consumer->>PositionedContent: Passes style prop (StyleProp<ViewStyle>)
PositionedContent-->>PositionedContent: Accepts style as StyleProp<ViewStyle>
PositionedContent-->>Consumer: Renders with applied style
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (2)
✨ Finishing Touches
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 (
|
interface PositionedContentProps { | ||
forceMount?: true | undefined; | ||
style?: ViewStyle; | ||
style?: StyleProp<ViewStyle>; |
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.
Although this changes to type, the code that implements it will not handle StyleProp<ViewStyle>
properly.
To make this work, every Content
component that extends this type for its props needs to handle cases where it is not just a ViewStyle
.
@avivash Thanks for contributing. I left a comment to be able to merge this PR. |
Components using
PositionedContentProps
are having theirstyle
type definitions from normalView
s andPressable
s overwritten.PositionedContentProps
are only typed to receive a single style object even though they actually work with arrays of style objects tooPressable Props
View Props
Summary by CodeRabbit
style
property in certain components to support a wider range of style formats, including arrays and other variations accepted by React Native.