Skip to content

Commit

Permalink
[Docs] Update docs to use prop-types
Browse files Browse the repository at this point in the history
Closes #890
  • Loading branch information
hisk authored and ljharb committed Apr 13, 2017
1 parent 8ab9528 commit 419478d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docs/api/ReactWrapper/setContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ NOTE: can only be called on a wrapper instance that is also the root instance.
#### Example

```jsx
import React from 'react';
import PropTypes from 'prop-types';

class SimpleComponent extends React.Component {
render() {
return <div>{this.context.name}</div>;
}
}
SimpleComponent.contextTypes = {
name: React.PropTypes.string,
name: PropTypes.string,
};
```
```jsx
Expand Down
5 changes: 4 additions & 1 deletion docs/api/ShallowWrapper/setContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ NOTE: can only be called on a wrapper instance that is also the root instance.
#### Example

```jsx
import React from 'react';
import PropTypes from 'prop-types';

class SimpleComponent extends React.Component {
render() {
return <div>{this.context.name}</div>;
}
}
SimpleComponent.contextTypes = {
name: React.PropTypes.string,
name: PropTypes.string,
};
```
```jsx
Expand Down
4 changes: 3 additions & 1 deletion docs/api/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ constructors.
### Example Usage

```jsx
import React from 'react';
import { render } from 'enzyme';
import PropTypes from 'prop-types';

describe('<Foo />', () => {
it('renders three `.foo-bar`s', () => {
Expand All @@ -36,7 +38,7 @@ describe('<Foo />', () => {
}
}
SimpleComponent.contextTypes = {
name: React.PropTypes.string,
name: PropTypes.string,
};

const context = { name: 'foo' };
Expand Down

0 comments on commit 419478d

Please sign in to comment.