DEV Community

Discussion on: Typescript. Simple React components.

Collapse
charlex profile image
HCB • Edited on

Instead of defaultProps, I use:

export const Button: React.FunctionComponent<IProps> = ({ block, children, type = 'button', ...shared }) => {
  return <button type={type} {...shared}>{children}</button>;

}