From c2e3735ffbb01d61bd5ca9ae2a5fd0ad93fa128f Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Wed, 26 Feb 2014 15:04:30 -0800 Subject: [PATCH] Rebuild docs for clearer propTypes --- docs/reusable-components.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/reusable-components.html b/docs/reusable-components.html index 96640ad58b..9cfebc5083 100644 --- a/docs/reusable-components.html +++ b/docs/reusable-components.html @@ -400,6 +400,10 @@ // A React component. optionalComponent: React.PropTypes.component, + // You can also declare that a prop is an instance of a class. This uses + // JS's instanceof operator. + optionalMessage: React.PropTypes.instanceOf(Message), + // You can ensure that your prop is limited to specific values by treating // it as an enum. optionalEnum: React.PropTypes.oneOf(['News', 'Photos']), @@ -407,7 +411,8 @@ // An object that could be one of many types optionalUnion: React.PropTypes.oneOfType([ React.PropTypes.string, - React.PropTypes.number + React.PropTypes.number, + React.PropTypes.instanceOf(Message) ]), // An array of a certain type @@ -419,10 +424,6 @@ fontSize: React.PropTypes.number }), - // You can also declare that a prop is an instance of a class. This uses - // JS's instanceof operator. - someClass: React.PropTypes.instanceOf(SomeClass), - // You can chain any of the above with isRequired to make sure a warning is // shown if the prop isn't provided. requiredFunc: React.PropTypes.func.isRequired,