diff --git a/docs/api/ShallowWrapper/at.md b/docs/api/ShallowWrapper/at.md
index ef3334cc3..258a7268e 100644
--- a/docs/api/ShallowWrapper/at.md
+++ b/docs/api/ShallowWrapper/at.md
@@ -19,7 +19,7 @@ Returns a wrapper around the node at a given index of the current wrapper.
```jsx
const wrapper = shallow();
-expect(wrapper.find(Foo).at(0).props().foo).to.equal("bar");
+expect(wrapper.find(Foo).at(0).props().foo).to.equal('bar');
```
diff --git a/docs/api/ShallowWrapper/contains.md b/docs/api/ShallowWrapper/contains.md
index 183f13854..fe18295d8 100644
--- a/docs/api/ShallowWrapper/contains.md
+++ b/docs/api/ShallowWrapper/contains.md
@@ -22,11 +22,11 @@ the ones passed in.
```jsx
-const wrapper = shallow(
+const wrapper = shallow((
+ );
}
```
diff --git a/docs/api/ShallowWrapper/every.md b/docs/api/ShallowWrapper/every.md
index 78fbaa52c..829823948 100644
--- a/docs/api/ShallowWrapper/every.md
+++ b/docs/api/ShallowWrapper/every.md
@@ -18,13 +18,13 @@ Returns whether or not all of the nodes in the wrapper match the provided select
#### Examples
```jsx
-const wrapper = shallow(
+const wrapper = shallow((
-);
+));
expect(wrapper.find('.foo').every('.foo')).to.equal(true);
expect(wrapper.find('.foo').every('.qoo')).to.equal(false);
expect(wrapper.find('.foo').every('.bar')).to.equal(false);
diff --git a/docs/api/ShallowWrapper/everyWhere.md b/docs/api/ShallowWrapper/everyWhere.md
index d644625c6..6f86920f4 100644
--- a/docs/api/ShallowWrapper/everyWhere.md
+++ b/docs/api/ShallowWrapper/everyWhere.md
@@ -18,13 +18,13 @@ Returns whether or not all of the nodes in the wrapper pass the provided predica
#### Example
```jsx
-const wrapper = shallow(
+const wrapper = shallow((
-);
+));
expect(wrapper.find('.foo').everyWhere(n => n.hasClass('foo'))).to.equal(true);
expect(wrapper.find('.foo').everyWhere(n => n.hasClass('qoo'))).to.equal(false);
expect(wrapper.find('.foo').everyWhere(n => n.hasClass('bar'))).to.equal(false);
diff --git a/docs/api/ShallowWrapper/find.md b/docs/api/ShallowWrapper/find.md
index 85dd30579..6407a3470 100644
--- a/docs/api/ShallowWrapper/find.md
+++ b/docs/api/ShallowWrapper/find.md
@@ -47,7 +47,7 @@ expect(wrapper.find('Foo')).to.have.length(1);
Object Property Selector:
```jsx
const wrapper = shallow();
-expect(wrapper.find({prop: 'value'})).to.have.length(1);
+expect(wrapper.find({ prop: 'value' })).to.have.length(1);
```
diff --git a/docs/api/ShallowWrapper/first.md b/docs/api/ShallowWrapper/first.md
index e7c645abc..30408e946 100644
--- a/docs/api/ShallowWrapper/first.md
+++ b/docs/api/ShallowWrapper/first.md
@@ -14,5 +14,5 @@ Reduce the set of matched nodes to the first in the set.
```jsx
const wrapper = shallow();
-expect(wrapper.find(Foo).first().props().foo).to.equal("bar");
+expect(wrapper.find(Foo).first().props().foo).to.equal('bar');
```
diff --git a/docs/api/ShallowWrapper/forEach.md b/docs/api/ShallowWrapper/forEach.md
index f8e3174e7..baa7e6ef4 100644
--- a/docs/api/ShallowWrapper/forEach.md
+++ b/docs/api/ShallowWrapper/forEach.md
@@ -21,15 +21,15 @@ instance.
#### Example
```jsx
-const wrapper = shallow(
+const wrapper = shallow((
-);
+));
-wrapper.find('.foo').forEach(function (node) {
+wrapper.find('.foo').forEach((node) => {
expect(node.hasClass('foo')).to.equal(true);
});
```
diff --git a/docs/api/ShallowWrapper/get.md b/docs/api/ShallowWrapper/get.md
index 0627333d0..eff3f4340 100644
--- a/docs/api/ShallowWrapper/get.md
+++ b/docs/api/ShallowWrapper/get.md
@@ -19,7 +19,7 @@ Returns the node at a given index of the current wrapper.
```jsx
const wrapper = shallow();
-expect(wrapper.find(Foo).get(0).props.foo).to.equal("bar");
+expect(wrapper.find(Foo).get(0).props.foo).to.equal('bar');
```
diff --git a/docs/api/ShallowWrapper/getNode.md b/docs/api/ShallowWrapper/getNode.md
index 9b5dae298..6480e93e7 100644
--- a/docs/api/ShallowWrapper/getNode.md
+++ b/docs/api/ShallowWrapper/getNode.md
@@ -15,16 +15,14 @@ If the current wrapper is wrapping the root component, returns the root componen
```jsx
const element = (
-
-
-
-
+
+
+
+
);
-class MyComponent extends React.Component {
- render() {
- return element;
- }
+function MyComponent() {
+ return element;
}
const wrapper = shallow();
diff --git a/docs/api/ShallowWrapper/getNodes.md b/docs/api/ShallowWrapper/getNodes.md
index ebffd742b..baebe3a15 100644
--- a/docs/api/ShallowWrapper/getNodes.md
+++ b/docs/api/ShallowWrapper/getNodes.md
@@ -17,15 +17,13 @@ If the current wrapper is wrapping the root component, returns the root componen
const one = ;
const two = ;
-class Test extends React.Component {
- render() {
- return (
-
- { one }
- { two }
-
- );
- }
+function Test() {
+ return (
+
+ {one}
+ {two}
+
+ );
}
const wrapper = shallow();
diff --git a/docs/api/ShallowWrapper/html.md b/docs/api/ShallowWrapper/html.md
index 4a628812d..542f06e32 100644
--- a/docs/api/ShallowWrapper/html.md
+++ b/docs/api/ShallowWrapper/html.md
@@ -14,33 +14,25 @@ Note: can only be called on a wrapper of a single node.
#### Examples
```jsx
-class Foo extends React.Component {
- render() {
- return ();
- }
+function Foo() {
+ return ();
}
```
```jsx
-class Bar extends React.Component {
- render() {
- return (
-
');
+expect(wrapper.find(Foo).html()).to.equal('');
```
```jsx
diff --git a/docs/api/ShallowWrapper/key.md b/docs/api/ShallowWrapper/key.md
index 72c80d34e..c0487acf9 100644
--- a/docs/api/ShallowWrapper/key.md
+++ b/docs/api/ShallowWrapper/key.md
@@ -8,11 +8,11 @@ NOTE: can only be called on a wrapper of a single node.
```jsx
-const wrapper = shallow(
+const wrapper = shallow((
{['foo', 'bar'].map(s =>
{s}
)}
-).find('li');
+)).find('li');
expect(wrapper.at(0).key()).to.equal('foo');
expect(wrapper.at(1).key()).to.equal('bar');
```
diff --git a/docs/api/ShallowWrapper/last.md b/docs/api/ShallowWrapper/last.md
index af5883a12..779460b79 100644
--- a/docs/api/ShallowWrapper/last.md
+++ b/docs/api/ShallowWrapper/last.md
@@ -14,5 +14,5 @@ Reduce the set of matched nodes to the last in the set.
```jsx
const wrapper = shallow();
-expect(wrapper.find(Foo).last().props().foo).to.equal("bar");
+expect(wrapper.find(Foo).last().props().foo).to.equal('bar');
```
diff --git a/docs/api/ShallowWrapper/map.md b/docs/api/ShallowWrapper/map.md
index dd2d1e192..a4b019702 100644
--- a/docs/api/ShallowWrapper/map.md
+++ b/docs/api/ShallowWrapper/map.md
@@ -21,16 +21,16 @@ the original instance.
#### Example
```jsx
-const wrapper = shallow(
+const wrapper = shallow((
+ );
}
+MyComponent.propTypes = {
+ includedProp: PropTypes.string.isRequired,
+};
+
const wrapper = shallow();
-expect(wrapper.props().includedProp).to.equal("Success!");
+expect(wrapper.props().includedProp).to.equal('Success!');
// Warning: .props() only returns props that are passed to the root node,
// which does not include excludedProp in this example.
// See the note above about wrapper.instance().props.
-wrapper.props();
+console.log(wrapper.props());
// {children: "Hello", className: "foo bar", includedProp="Success!"}
-wrapper.instance().props;
+console.log(wrapper.instance().props);
// {children: "Hello", className: "foo bar", includedProp:"Success!", excludedProp: "I'm not included"}
-
```
diff --git a/docs/api/ShallowWrapper/reduce.md b/docs/api/ShallowWrapper/reduce.md
index f587a9dac..2b368a897 100644
--- a/docs/api/ShallowWrapper/reduce.md
+++ b/docs/api/ShallowWrapper/reduce.md
@@ -26,16 +26,14 @@ first invocation of the reducing function.
#### Example
```jsx
-class Foo extends React.Component {
- render() {
- return (
-
-
-
-
-
- );
- }
+function Foo() {
+ return (
+
+
+
+
+
+ );
}
```
diff --git a/docs/api/ShallowWrapper/reduceRight.md b/docs/api/ShallowWrapper/reduceRight.md
index d55e2524e..89cebbaac 100644
--- a/docs/api/ShallowWrapper/reduceRight.md
+++ b/docs/api/ShallowWrapper/reduceRight.md
@@ -26,16 +26,14 @@ first invocation of the reducing function.
#### Example
```jsx
-class Foo extends React.Component {
- render() {
- return (
-
-
-
-
-
- );
- }
+function Foo() {
+ return (
+
+
+
+
+
+ );
}
```
diff --git a/docs/api/ShallowWrapper/render.md b/docs/api/ShallowWrapper/render.md
index d08769623..b9038f626 100644
--- a/docs/api/ShallowWrapper/render.md
+++ b/docs/api/ShallowWrapper/render.md
@@ -14,22 +14,18 @@ Note: can only be called on a wrapper of a single node.
#### Examples
```jsx
-class Foo extends React.Component {
- render() {
- return ();
- }
+function Foo() {
+ return ();
}
```
```jsx
-class Bar extends React.Component {
- render() {
- return (
-
-
-
- );
- }
+function Bar() {
+ return (
+
+
+
+ );
}
```
diff --git a/docs/api/ShallowWrapper/setContext.md b/docs/api/ShallowWrapper/setContext.md
index 4ba9fb62f..b02897f3c 100644
--- a/docs/api/ShallowWrapper/setContext.md
+++ b/docs/api/ShallowWrapper/setContext.md
@@ -21,13 +21,11 @@ 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
;
}
SimpleComponent.contextTypes = {
name: PropTypes.string,
diff --git a/docs/api/ShallowWrapper/setProps.md b/docs/api/ShallowWrapper/setProps.md
index 7f91d89d3..743222437 100644
--- a/docs/api/ShallowWrapper/setProps.md
+++ b/docs/api/ShallowWrapper/setProps.md
@@ -25,13 +25,16 @@ NOTE: can only be called on a wrapper instance that is also the root instance.
#### Example
```jsx
-class Foo extends React.Component {
- render() {
- return (
-
+
);
}
}
diff --git a/docs/api/ShallowWrapper/shallow.md b/docs/api/ShallowWrapper/shallow.md
index bc24de457..f97d5d3ca 100644
--- a/docs/api/ShallowWrapper/shallow.md
+++ b/docs/api/ShallowWrapper/shallow.md
@@ -21,26 +21,22 @@ NOTE: can only be called on wrapper of a single node.
#### Examples
```jsx
-class Bar extends React.Component {
- render() {
- return (
-
@@ -53,6 +53,6 @@ expect(wrapper.find('.clicks-1').length).to.equal(1);
- Currently, event simulation for the shallow renderer does not propagate as one would normally
expect in a real environment. As a result, one must call `.simulate()` on the actual node that has
the event handler set.
-- Even though the name would imply this simulates an actual event, `.simulate()` will in fact
+- Even though the name would imply this simulates an actual event, `.simulate()` will in fact
target the component's prop based on the event you give it. For example, `.simulate('click')` will
actually get the `onClick` prop and call it.
diff --git a/docs/api/ShallowWrapper/slice.md b/docs/api/ShallowWrapper/slice.md
index e53121966..203253570 100644
--- a/docs/api/ShallowWrapper/slice.md
+++ b/docs/api/ShallowWrapper/slice.md
@@ -19,26 +19,26 @@ Returns a new wrapper with a subset of the nodes of the original wrapper, accord
#### Examples
```jsx
-const wrapper = shallow(
-
+));
expect(wrapper.find('.foo').slice(1, 2)).to.have.length(1);
expect(wrapper.find('.foo').slice(1, 2).at(0).hasClass('bar')).to.equal(true);
```
diff --git a/docs/api/ShallowWrapper/some.md b/docs/api/ShallowWrapper/some.md
index 7958bd334..593bed552 100644
--- a/docs/api/ShallowWrapper/some.md
+++ b/docs/api/ShallowWrapper/some.md
@@ -18,13 +18,13 @@ Returns whether or not any of the nodes in the wrapper match the provided select
#### Examples
```jsx
-const wrapper = shallow(
+const wrapper = shallow((
-);
+));
expect(wrapper.find('.foo').some('.qoo')).to.equal(true);
expect(wrapper.find('.foo').some('.foo')).to.equal(true);
expect(wrapper.find('.foo').some('.bar')).to.equal(false);
diff --git a/docs/api/ShallowWrapper/someWhere.md b/docs/api/ShallowWrapper/someWhere.md
index a850d7cfb..8a174b5b9 100644
--- a/docs/api/ShallowWrapper/someWhere.md
+++ b/docs/api/ShallowWrapper/someWhere.md
@@ -18,13 +18,13 @@ Returns whether or not any of the nodes in the wrapper pass the provided predica
#### Example
```jsx
-const wrapper = shallow(
+const wrapper = shallow((
-);
+));
expect(wrapper.find('.foo').someWhere(n => n.hasClass('qoo'))).to.equal(true);
expect(wrapper.find('.foo').someWhere(n => n.hasClass('foo'))).to.equal(true);
expect(wrapper.find('.foo').someWhere(n => n.hasClass('bar'))).to.equal(false);
diff --git a/docs/api/ShallowWrapper/tap.md b/docs/api/ShallowWrapper/tap.md
index e4c518aa1..ea59f8415 100644
--- a/docs/api/ShallowWrapper/tap.md
+++ b/docs/api/ShallowWrapper/tap.md
@@ -19,15 +19,14 @@ This is helpful when debugging nodes in method chains.
```jsx
-const result = shallow(
+const result = shallow((
xxx
yyy
zzz
-)
+))
.find('li')
.tap(n => console.log(n.debug()))
-.map(n => n.text())
-;
+.map(n => n.text());
```
diff --git a/docs/api/ShallowWrapper/type.md b/docs/api/ShallowWrapper/type.md
index 89cba53e6..45c16bcc0 100644
--- a/docs/api/ShallowWrapper/type.md
+++ b/docs/api/ShallowWrapper/type.md
@@ -15,44 +15,36 @@ Note: can only be called on a wrapper of a single node.
#### Examples
```jsx
-class Foo extends React.Component {
- render() {
- return ;
- }
+function Foo() {
+ return ;
}
const wrapper = shallow();
expect(wrapper.type()).to.equal('div');
```
```jsx
-class Foo extends React.Component {
- render() {
- return (
-