Passing State as Prop and State Updater as Prop #3051
-
The docs don't seem to show this in the props section. We just have simple examples with a button. How would I pass my signal value down? The variable is not the same data type as the data it holds. And how exactly should I pass any updaters down? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm not sure I understand. You can pass Signals in props like normal by adding a field There is a section in the guide that does this with |
Beta Was this translation helpful? Give feedback.
I'm not sure I understand. You can pass Signals in props like normal by adding a field
field: Signal<Data>
to your props. If you read the signal in your child component, it will rerun the component when the signal changesThere is a section in the guide that does this with
ReadOnlySignal
for theStoryListing
component: https://dioxuslabs.com/learn/0.5/guide/state