I am trying to setup a defaultProps for some field of an array of object prop.
interface IProps {
steps: Array<{
id: number | string
route?: string
label?: string
completed?: boolean
disabled?: boolean
active?: boolean
}>
}
class Stepper extends React.Component<IProps, {}> {
static defaultProps: IProps = {
steps: ???
}
render() {
return <div></div>
}
}
I tried to look up online but I couldn't find a way of setting defaultProps for my case.
I would like to set some default value only for completed, disabled and active and leave the other as they are.
Is there an easy way to do this ?
ISomeOfIPropswithcompleted,disabledandactivemembers. And definedefaultProps: ISomeOfIProps? :)