pariveda-accelerators / react-toolkit

Component library and other helpful tooling when building an application using React
MIT License
1 stars 1 forks source link

Feature - Spacing & Layout #33

Closed zakbutcher closed 4 years ago

zakbutcher commented 4 years ago

Net New

// proposed approach
export const Component = props => (
  const DEFAULT_PROPS = ['id', 'className', 'children'];
  const defaultProps = getProps(props);
  return <div {...defaultProps} />
)

vs

// traditional / alternative approach
export const Component = props => (
  const {
    id,
    className,
    children,
  } = props
  return (
    <div id={id} className={className}>
      {children}
    </div>
  )
)

Updates