In ReactJS, you can access the ID passed to a route with {this.props.params.id}. However, how do you use PropTypes to typecheck the params.id property? The below doesn't work and throws an error.
Person.propTypes = {
params.id: React.PropTypes.string
};
Use React.PropTypes.shape to verify an object's properties -- https://facebook.github.io/react/docs/typechecking-with-proptypes.html
Something like this should work:
Person.propTypes = {
params: React.PropTypes.shape({
id: React.PropTypes.string
})
};