Skip to content

React Utils - v0.0.3

Choose a tag to compare

@ItsJonQ ItsJonQ released this 27 Jul 22:22
· 46 commits to master since this release

"Rest": Prop filtering

This update adds 2 new functions: getValidProps (alias restProps) and getCustomProps.

They work to filter in/out default React-safe props.

Examples

import React from 'react'
import getValidProps from '@helpscout/react-utils/dist/getValidProps'

class UncleRico extends React.Component {
  ...
  render () {
    const rest = {getValidProps(this.props)}
    return (<div {...rest} />}
  }
}