Fix: Align PositionedContentProps style with Pressable style prop#94
Fix: Align PositionedContentProps style with Pressable style prop#94avivash wants to merge 1 commit intoroninoss:mainfrom
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.
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
PositionedContentPropsare having theirstyletype definitions from normalViews andPressables overwritten.PositionedContentPropsare 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
styleproperty in certain components to support a wider range of style formats, including arrays and other variations accepted by React Native.