Releases: markalfred/react-generate-props
Releases · markalfred/react-generate-props
v0.6.0
v0.5.1
- Bump versions: Coveralls, Chai, Mocha, React, Babel,
- Switch from Circle CI to Travis CI
- Readme updates
v0.5.0
v0.4.0
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 orgenerateProps()
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' } } }
v0.3.0
- Generators are now deterministic by default. Previously, snapshot tests might break if
oneOf
oroneOfType
were used. opts
can now be passed as the second arg togenerateProps
to generate or omit required or optional types. Default:{ required: true, optional: false }
- Generators can be overridden via the
opts
argument. Syntax:generateProps(Component, { generators: { bool: () => false } })
string
,any
, andnode
generators now return exactly those strings. ('string'
,'any'
, or'node'
)- React 16 and the
prop-types
package are now supported.
A Note On React v15.3 - v16.0
If you are using React v15.3 or higher, you should port your PropTypes to the new prop-type
lib. https://github.com/facebook/prop-types