Skip to content

Commit

Permalink
[Docs] reduce/reduceRight: fix example code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tankunpeng authored and ljharb committed Mar 24, 2019
1 parent edd3a20 commit 0c3277c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/api/ReactWrapper/reduce.md
Expand Up @@ -36,8 +36,8 @@ function Foo() {

```jsx
const wrapper = mount(<Foo />);
const total = wrapper.find(Bar).reduce((amount, n) => amount + n.prop('amount'));
expect(total).to.equal(16);
const total = wrapper.find(Bar).reduce((amount, n) => amount + n.prop('amount'), 0);
expect(total).to.equal(14);
```


Expand Down
4 changes: 2 additions & 2 deletions docs/api/ReactWrapper/reduceRight.md
Expand Up @@ -36,8 +36,8 @@ function Foo() {

```jsx
const wrapper = mount(<Foo />);
const total = wrapper.find(Bar).reduceRight((amount, n) => amount + n.prop('amount'));
expect(total).to.equal(16);
const total = wrapper.find(Bar).reduceRight((amount, n) => amount + n.prop('amount'), 0);
expect(total).to.equal(14);
```


Expand Down
4 changes: 2 additions & 2 deletions docs/api/ShallowWrapper/reduce.md
Expand Up @@ -36,8 +36,8 @@ function Foo() {

```jsx
const wrapper = shallow(<Foo />);
const total = wrapper.find(Bar).reduce((amount, n) => amount + n.prop('amount'));
expect(total).to.equal(16);
const total = wrapper.find(Bar).reduce((amount, n) => amount + n.prop('amount'), 0);
expect(total).to.equal(14);
```


Expand Down
4 changes: 2 additions & 2 deletions docs/api/ShallowWrapper/reduceRight.md
Expand Up @@ -36,8 +36,8 @@ function Foo() {

```jsx
const wrapper = shallow(<Foo />);
const total = wrapper.find(Bar).reduceRight((amount, n) => amount + n.prop('amount'));
expect(total).to.equal(16);
const total = wrapper.find(Bar).reduceRight((amount, n) => amount + n.prop('amount'), 0);
expect(total).to.equal(14);
```


Expand Down

0 comments on commit 0c3277c

Please sign in to comment.