You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The second argument to the `styled` function also accepts a function that returns a styles object based on the props passed to the component:
190
+
The second argument to the `styled` function also accepts a style resolver function that returns a styles object based on the props passed to the component:
@@ -213,7 +215,24 @@ Now you can use these props to style the component:
213
215
```
214
216
215
217
> [!IMPORTANT]
216
-
> A proxy is used to differentiate between style props and those passed directly to the component. Therefore, only style props should be accessed within the function to ensure proper filtering.
218
+
> A proxy is used to differentiate between style props and those passed directly to the component. Only style props should be accessed from the first parameter of the style resolver function to ensure proper filtering.
219
+
220
+
To access the props passed to the component, you can use the second parameter of the style resolver function. This is useful for applying styles based on props that are not style props:
The second argument to the `styled` function also accepts a function that returns a styles object based on the props passed to the component:
31
+
The second argument to the `styled` function also accepts a style resolver function that returns a styles object based on the props passed to the component:
@@ -53,7 +55,25 @@ Now you can use these props to style the component:
53
55
</Grid>
54
56
```
55
57
56
-
**Note**, a proxy is used to differentiate between style props and those passed directly to the component. Therefore, only style props should be accessed within the function to ensure proper filtering.
58
+
> [!IMPORTANT]
59
+
> A proxy is used to differentiate between style props and those passed directly to the component. Only style props should be accessed from the first parameter of the style resolver function to ensure proper filtering.
60
+
61
+
To access the props passed to the component, you can use the second parameter of the style resolver function. This is useful for applying styles based on props that are not style props:
0 commit comments