SHARE
TWEET

Untitled

a guest Sep 16th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top