Skip to content

Standardize optional params across repository. #664

Answered by kotAPI
CCleanerShot asked this question in Q&A
Discussion options

You must be logged in to vote

Alright, we'll just define the type and we'll apply the default values on the prop definition of the component then

Something like this, where hello is the default value of prop1 for instance

type ComponentProps {
  prop1: 'string'
}

const Comp = ({prop1='hello'}:ComponentProps){

}

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kotAPI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
good first issue Good for newcomers
3 participants
Converted from issue

This discussion was converted from issue #170 on December 21, 2024 12:11.