Skip to content

Instantly share code, notes, and snippets.

@phusick
Created June 13, 2018 10:43
Show Gist options
  • Save phusick/f2cd66f104beda80222dd45d2128b427 to your computer and use it in GitHub Desktop.
Save phusick/f2cd66f104beda80222dd45d2128b427 to your computer and use it in GitHub Desktop.
React Route Shapes
import PropTypes from 'prop-types';
export default PropTypes.shape({
action: PropTypes.string.isRequired,
block: PropTypes.func.isRequired,
createHref: PropTypes.func.isRequired,
go: PropTypes.func.isRequired,
goBack: PropTypes.func.isRequired,
goForward: PropTypes.func.isRequired,
length: PropTypes.number.isRequired,
listen: PropTypes.func.isRequired,
location: PropTypes.object.isRequired,
push: PropTypes.func.isRequired,
replace: PropTypes.func.isRequired,
});
import { shape, string } from 'prop-types';
export default shape({
hash: string.isRequired,
key: string.isRequired,
pathname: string.isRequired,
search: string.isRequired,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment