Skip to content

v0.4.0

Compare
Choose a tag to compare
@markalfred markalfred released this 10 Aug 14:12
· 145 commits to master since this release

Breaking Changes:

  • #21 - Default generators now produce values that match their propName.
generate({ foo: PropType.string, bar: PropTypes.object })
// Old: => { foo: 'string', bar: {} }
// New: => { foo: 'foo', bar: { bar: 'bar' } }
  • #21 - Generator callbacks now receive propName as their first argument, and their definitions' argument as the second.

  • #19 - generateProps.init() must be called prior to components being imported or generateProps() being called.

Non-breaking Changes:

  • #17 - Fixed: Deeply nested props wouldn't respect opts argument.
generate({
  foo: PropType.shape({
    bar: PropType.shape({
      baz: PropType.string
    })
  })
}, { optional: true })
// Old: => { foo: {} }
// New: => { foo: { bar: { baz: 'baz' } } }