-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FR]: Default style property in useSx
option
#39
Comments
@zmin9 need discussion |
I think |
I think the priority of the |
oh I agree on lowest priority of // without default props
useSx({
style: {
borderWidth: 1, // it overwrite component sxProps although it is default style
...props?.style,
},
/* ... */
...props,
}) To be clear, it would be good that the |
Right, let's do like this. |
@mym0404 <View style={[getStyle(), { backgroundColor: 'red }]} /> Also, I think the priority with |
I agree with that. Did you read the updated docs for this? |
If passing plain old style into I am curious about Conversely, finding any use-cases that can't be covered with |
If we need to use the state value of some child component, as in the example below, Or why not just have <View style={[getThemedStyle({mt: 2}), getStyle(), getThemedStyle({mb: 4})]} /> |
+) |
From this discussion, it was more clear that I think we have to remove it.(with introducing In your reply, How about this? Create a new hook const getS = useSxStyle();
return <View style={getS({ mt: 2, /* ... */ })}/> I insist that Note I created |
Resolve #39 Default style property in `useSx` option
🎉 This issue has been resolved in version 3.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the problem
At now, the
getStyle
function takesSxProps
as a parameter for passing additional style properties.It is handled with lowest priority because it is used for default property sometimes.
We should separate a concern between defining default style properties and passing additional style properties.
Describe the solution
Step 1. Create
default(not fixed name)
options touseSx
hook.Important
This
SxProps
should be handled as most lowest priorityStep 2(NEED DISCUSSION). The priority of
SxProps
asgetStyle
parameter should be highest one?(lower thanstyle
).I have no idea how this priority should be updated.
Note
We should update this new behaviors in the docs.
Code of Conduct
The text was updated successfully, but these errors were encountered: