How to define a default value for properties in svelte 5.. #13363
scottandrew
started this conversation in
General
Replies: 1 comment
-
You have a Props Interface or type that defines the shape of your component props. That Interface is the place where you have to mark optional props: interface Props {
required: string
optional?: string
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How do I define a default value for component props? Do I have to mark them as accepting undefined? The following doesn't work and tells me I need to provide the values that have defaults assigned:
Beta Was this translation helpful? Give feedback.
All reactions