Skip to content

Commit

Permalink
[fixed] view propType validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Sep 13, 2015
1 parent 6cab749 commit 00435ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils/propTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export let eventComponent = PropTypes.oneOfType([
})
])

let viewNames = PropTypes.oneOf(
Object.keys(Views).map(k => Views[k])
);

export let accessor = PropTypes.oneOfType([
PropTypes.string,
PropTypes.func
Expand All @@ -26,9 +30,7 @@ export let dateFormat = createChainableTypeChecker(
(...args) => localizer.propType && localizer.propType(...args))

export let views = PropTypes.oneOfType([
PropTypes.oneOf(
Object.keys(Views).map(k => Views[k])
),
PropTypes.arrayOf(viewNames),
all([
PropTypes.object,
(props, name, component)=>{
Expand Down

0 comments on commit 00435ad

Please sign in to comment.