is defaultProps still needed in react 18 & Typecript

23 Views Asked by At

export function Modal({ open, body, header, onClose, loading }: Props) {
  return (
    ...
  )
    
}

Modal.defaultProps = {
  loading: false,
}

My understanding is that this is not needed and can be simplified like this

 export function Modal({ open, body, header, onClose, loading = false }: Props) {
      return (
        ...
      )
        
    }

0

There are 0 best solutions below