From 2f51451165e0515688ab14944685d486314e6192 Mon Sep 17 00:00:00 2001 From: Raymond Ha Date: Wed, 29 Oct 2014 20:59:16 -0700 Subject: [PATCH] Update deprecated propTypes --- docs/05-reusable-components.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/05-reusable-components.md b/docs/05-reusable-components.md index 5ad85a53..22d188e5 100644 --- a/docs/05-reusable-components.md +++ b/docs/05-reusable-components.md @@ -25,12 +25,12 @@ React.createClass({ optionalObject: React.PropTypes.object, optionalString: React.PropTypes.string, - // Anything that can be rendered: numbers, strings, components or an array + // Anything that can be rendered: numbers, strings, elements or an array // containing these types. - optionalRenderable: React.PropTypes.renderable, + optionalNode: React.PropTypes.node, - // A React component. - optionalComponent: React.PropTypes.component, + // A React element. + optionalElement: React.PropTypes.element, // You can also declare that a prop is an instance of a class. This uses // JS's instanceof operator. @@ -120,13 +120,13 @@ React.render( ## Single Child -With `React.PropTypes.component` you can specify that only a single child can be passed to +With `React.PropTypes.element` you can specify that only a single child can be passed to a component as children. ```javascript var MyComponent = React.createClass({ propTypes: { - children: React.PropTypes.component.isRequired + children: React.PropTypes.element.isRequired }, render: function() {