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
Copy file name to clipboardExpand all lines: website/pages/docs/guides/adapting-based-on-props.mdx
+47-1
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ return props accepted by a `twc` component. It's similar to `React.ComponentProp
30
30
<details>
31
31
<summary>Why is the prop prefixed by a dollar?</summary>
32
32
33
-
We call the prop `$primary` a "transient prop", transient props can be consumed by the components but are not passed to the underlying components. It our case, it means the `<button>` will not get a `<button $primary="true">` attribute in the DOM.
33
+
We call the prop `$primary` a "transient prop". A transient prop starts with a `$`, it can be consumed by the uppermost component layer but are not passed to the underlying components. It our case, it means the `<button>` will not get a `<button $primary="true">` attribute in the DOM.
34
34
35
35
</details>
36
36
@@ -66,3 +66,49 @@ export default () => (
66
66
</div>
67
67
);
68
68
```
69
+
70
+
## Customize transient props
71
+
72
+
By default, all props starting with a `$` are considered _transient_. This is a is a hint that it is meant exclusively for the uppermost component layer and should not be passed further down. In other terms, it prevents your DOM element to have unexpected props.
73
+
74
+
If you don't like the `$` prefix, you can customize transient props for a specific component using `transientProps` constructor.
0 commit comments