From e464c07e7f9e2203ead94b1c20ffe6814ad6e771 Mon Sep 17 00:00:00 2001 From: Joshua Date: Fri, 29 Sep 2017 06:24:10 -0500 Subject: [PATCH] Use ES6 module instead of commonJS (#10953) * Use ES6 module instead of commonJS As far as I know, we're using ES6 modules throughout the docs. For the sake of consistency :) * Convert all CommonJS requires to ES6 module --- docs/context.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/context.md b/docs/context.md index 3054de66..5fc92a59 100644 --- a/docs/context.md +++ b/docs/context.md @@ -67,7 +67,7 @@ class MessageList extends React.Component { In this example, we manually thread through a `color` prop in order to style the `Button` and `Message` components appropriately. Using context, we can pass this through the tree automatically: ```javascript{6,13-15,21,28-30,40-42} -const PropTypes = require('prop-types'); +import PropTypes from 'prop-types'; class Button extends React.Component { render() { @@ -163,7 +163,7 @@ If `contextTypes` is defined within a component, the following [lifecycle method Stateless functional components are also able to reference `context` if `contextTypes` is defined as a property of the function. The following code shows a `Button` component written as a stateless functional component. ```javascript -const PropTypes = require('prop-types'); +import PropTypes from 'prop-types'; const Button = ({children}, context) =>