Created
September 5, 2019 07:33
-
-
Save joe-oli/5b7fb6f20ef6d3eaa0d01ddde5adfc4b to your computer and use it in GitHub Desktop.
random react notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PropTypes.objectOf is used when describing an object whose properties are all the same type. | |
const objectOfProp = { | |
latitude: 37.331706, | |
longitude: -122.030783 | |
} | |
// PropTypes.objectOf(PropTypes.number) | |
PropTypes.shape is used when describing an object whose keys are known ahead of time, and may represent different types. | |
const shapeProp = { | |
name: 'Jane', | |
age: 25 | |
} | |
// PropTypes.shape({ name: PropTypes.string, age: PropTypes.number }) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment