Last active
July 3, 2018 15:19
-
-
Save asiniy/1f6bdea8b1f58c58f294420fafa143c8 to your computer and use it in GitHub Desktop.
propTypes // Extending JavaScript with ease (beginner level tutorial)
This file contains 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
import React from 'react' | |
import PropTypes from 'react-proptypes' | |
class MyComponent extends React.Component { | |
// render logic here | |
} | |
MyComponent.propTypes = { | |
collectorGroup: PropTypes.shape({ | |
target_count: PropTypes.number.isRequired, | |
// a lot of other object properties here | |
}) | |
} | |
export default MyComponent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment