dillon1000/react
Commit
Browse files Introduce PropTypes.shape
This diff introduces PropType.shape which lets you type an object. PropType.object was already defined and since it isn't a function I couldn't really overload the meaning to also accept a type list. Instead of doing hackery, I decided to name it `shape`.
An example where this could be used is style:
```
propTypes: {
style: PropTypes.shape({
color: PropStyle.string,
fontSize: PropTypes.number
})
}
```Changed paths2 files
First-parent comparisonsrc/core/ReactPropTypes.js ModifiedM src/core/__tests__/ReactPropTypes-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…