Skip to content

Commit

Permalink
Merge pull request #47 from 4Catalyzer/matchShape
Browse files Browse the repository at this point in the history
Don't use matchShape internally
  • Loading branch information
taion authored Nov 17, 2016
2 parents dd5959b + 10e2617 commit 04c9901
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/BaseLink.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
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,
to: React.PropTypes.oneOfType([
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,
Expand Down
3 changes: 2 additions & 1 deletion src/PropTypes.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/createBaseRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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,
Expand Down

0 comments on commit 04c9901

Please sign in to comment.