-
Notifications
You must be signed in to change notification settings - Fork 135
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
Custom themed components are losing spacing props after upgrade from 2.3.0 to 2.4.0 #239
Comments
Hey @i-in-range 👋 Can you double check if this still happens with 2.4.1? The bug is most likely related to the memoizations we've added in this PR. |
The problem still exists, but it's not the only one for now. I noticed that when trying version 2.4.1, my child themed Views are being overridden by the parent's properties. Specifically, when the type RestyleProps = SpacingProps<Theme> &
BorderProps<Theme> &
LayoutProps<Theme> &
BackgroundColorProps<Theme> &
VariantProps<Theme, "pressable">; // or "view" |
Reproduced the issue on custom-themed-nested-components-props-overwrite branch by adding unit tests. Couldn't yet found the reason, so if anyone wants to take over, feel free to use the branch: run |
Hey @i-in-range! We managed to find a potential fix for the issue you discovered. Please see this PR for more details. As Marek mentioned above, it was related to the memoizations added in a previous PR. |
Current behavior
Custom themed components are losing
padding
andmargin
properties after I updated package from 2.3.0 to 2.4.0. I have got next console.log of props that my themed components (parent and nested) receives:But the nested component (the second one) actually has settings of
margin: 8
andpadding: 8
Expected behavior
To Reproduce
Basic
theme
object:Simple themed component:
And finally app.tsx:
Platform:
Environment
The issue comes when I concurrently updated Expo to 48.0.0 and @shopify/restyle to 2.4.0
Before upgrade I use Expo 47.0.0 and @shopify/restyle 2.3.0
Now I downgraded @shopify/restyle to 2.3.0 and it works well with Expo 48.0.0
The text was updated successfully, but these errors were encountered: