diff --git a/_js/live_editor.js b/_js/live_editor.js index 7852872a5..3a95ac5fb 100644 --- a/_js/live_editor.js +++ b/_js/live_editor.js @@ -10,8 +10,8 @@ var IS_MOBILE = ( var CodeMirrorEditor = React.createClass({ propTypes: { - lineNumbers: React.PropTypes.bool, - onChange: React.PropTypes.func, + lineNumbers: PropTypes.bool, + onChange: PropTypes.func, }, getDefaultProps: function() { return { @@ -80,12 +80,12 @@ var ReactPlayground = React.createClass({ MODES: {JSX: 'JSX', JS: 'JS'}, //keyMirror({JSX: true, JS: true}), propTypes: { - codeText: React.PropTypes.string.isRequired, - transformer: React.PropTypes.func, - renderCode: React.PropTypes.bool, - showCompiledJSTab: React.PropTypes.bool, - showLineNumbers: React.PropTypes.bool, - editorTabTitle: React.PropTypes.string, + codeText: PropTypes.string.isRequired, + transformer: PropTypes.func, + renderCode: PropTypes.bool, + showCompiledJSTab: PropTypes.bool, + showLineNumbers: PropTypes.bool, + editorTabTitle: PropTypes.string, }, getDefaultProps: function() { diff --git a/_layouts/default.html b/_layouts/default.html index 0dc4dd952..f40bec625 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -48,6 +48,7 @@ + diff --git a/warnings/dont-call-proptypes.md b/warnings/dont-call-proptypes.md index ffc8fcf94..e1a428099 100644 --- a/warnings/dont-call-proptypes.md +++ b/warnings/dont-call-proptypes.md @@ -18,7 +18,7 @@ The normal usage of PropTypes is still supported: ```javascript Button.propTypes = { - highlighted: React.PropTypes.bool + highlighted: PropTypes.bool }; ``` @@ -29,9 +29,9 @@ Nothing changes here. Using PropTypes in any other way than annotating React components with them is no longer supported: ```javascript -var apiShape = React.PropTypes.shape({ - body: React.PropTypes.object, - statusCode: React.PropTypes.number.isRequired +var apiShape = PropTypes.shape({ + body: PropTypes.object, + statusCode: PropTypes.number.isRequired }).isRequired; // Not supported! @@ -49,13 +49,13 @@ Inspect the stack trace produced by the warning. You will find the component def ```js Button.propTypes = { highlighted: ThirdPartyPropTypes.deprecated( - React.PropTypes.bool, + PropTypes.bool, 'Use `active` prop instead' ) } ``` -In this case, `ThirdPartyPropTypes.deprecated` is a wrapper calling `React.PropTypes.bool`. This pattern by itself is fine, but triggers a false positive because React thinks you are calling PropTypes directly. The next section explains how to fix this problem for a library implementing something like `ThirdPartyPropTypes`. If it's not a library you wrote, you can file an issue against it. +In this case, `ThirdPartyPropTypes.deprecated` is a wrapper calling `PropTypes.bool`. This pattern by itself is fine, but triggers a false positive because React thinks you are calling PropTypes directly. The next section explains how to fix this problem for a library implementing something like `ThirdPartyPropTypes`. If it's not a library you wrote, you can file an issue against it. ### Fixing the false positive in third party PropTypes