Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. PropTypes.objectOf is used when describing an object whose properties are all the same type.
  2.  
  3. const objectOfProp = {
  4. latitude: 37.331706,
  5. longitude: -122.030783
  6. }
  7. // PropTypes.objectOf(PropTypes.number)
  8.  
  9. PropTypes.shape is used when describing an object whose keys are known ahead of time, and may represent different types.
  10.  
  11. const shapeProp = {
  12. name: 'Jane',
  13. age: 25
  14. }
  15. // PropTypes.shape({ name: PropTypes.string, age: PropTypes.number })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement