SolidJSS
SolidJSโ€ข3y agoโ€ข
2 replies
AesthetiCoder

splitProps default value

how can i define the default value of a prop with split prop, for example the "loader" prop is optional i want tha make it true by default, but it is undefined


const [ local, rest ] = splitProps(props, ['loader'])


yes i can use a ternary and validate the value but i want to set the default value if it is possible

  local.loader ? true : false
Was this page helpful?