From 10e261738391e4156ee85ddab15a3f558a6ef5f3 Mon Sep 17 00:00:00 2001 From: Jimmy Jia Date: Thu, 17 Nov 2016 13:29:25 -0500 Subject: [PATCH] Don't use matchShape internally --- src/BaseLink.js | 4 ++-- src/PropTypes.js | 3 ++- src/createBaseRouter.js | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/BaseLink.js b/src/BaseLink.js index ed9419ab..001c5a3e 100644 --- a/src/BaseLink.js +++ b/src/BaseLink.js @@ -1,7 +1,7 @@ import React from 'react'; import elementType from 'react-prop-types/lib/elementType'; -import { matchShape, routerShape } from './PropTypes'; +import { routerShape } from './PropTypes'; const propTypes = { Component: elementType.isRequired, @@ -9,7 +9,7 @@ const propTypes = { React.PropTypes.string, React.PropTypes.object, ]), - match: matchShape.isRequired, + match: React.PropTypes.object.isRequired, activeClassName: React.PropTypes.string, activeStyle: React.PropTypes.object, activePropName: React.PropTypes.string, diff --git a/src/PropTypes.js b/src/PropTypes.js index 63789a1a..29d5db72 100644 --- a/src/PropTypes.js +++ b/src/PropTypes.js @@ -1,7 +1,8 @@ import React from 'react'; // The shape might be different with a custom matcher or history enhancer, but -// the default matcher assumes and provides this shape. +// the default matcher assumes and provides this shape. As such, this validator +// is purely for user convenience and should not be used internally. export const matchShape = React.PropTypes.shape({ location: React.PropTypes.shape({ pathname: React.PropTypes.string.isRequired, diff --git a/src/createBaseRouter.js b/src/createBaseRouter.js index bd636308..872eeaf8 100644 --- a/src/createBaseRouter.js +++ b/src/createBaseRouter.js @@ -4,7 +4,7 @@ import StaticContainer from 'react-static-container'; import getRoutes from './getRoutes'; import HttpError from './HttpError'; -import { matchShape, routerShape } from './PropTypes'; +import { routerShape } from './PropTypes'; import RedirectException from './RedirectException'; export default function createBaseRouter({ @@ -13,7 +13,7 @@ export default function createBaseRouter({ render, }) { const propTypes = { - match: matchShape.isRequired, + match: React.PropTypes.object.isRequired, resolvedMatch: React.PropTypes.object.isRequired, matchContext: React.PropTypes.any, resolveElements: React.PropTypes.func.isRequired,