Skip to content

Commit

Permalink
[Docs] mount/shallow: update: fix semantics description
Browse files Browse the repository at this point in the history
Fixes #1405
  • Loading branch information
Lukas Kullmann authored and ljharb committed Jul 17, 2019
1 parent 4cad446 commit 3b3f808
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion docs/api/ReactWrapper/update.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# `.update() => Self`

Forces a re-render. Useful to run before checking the render output if something external
Syncs the enzyme component tree snapshot with the react component tree. Useful to run before checking the render output if something external
may be updating the state of the component somewhere.

NOTE: can only be called on a wrapper instance that is also the root instance.

NOTE: this does not force a re-render. Use `wrapper.setProps({})` to force a re-render.


#### Returns

Expand Down
4 changes: 3 additions & 1 deletion docs/api/ShallowWrapper/update.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# `.update() => Self`

Forces a re-render. Useful to run before checking the render output if something external
Syncs the enzyme component tree snapshot with the react component tree. Useful to run before checking the render output if something external
may be updating the state of the component somewhere.

NOTE: can only be called on a wrapper instance that is also the root instance.

NOTE: this does not force a re-render. Use `wrapper.setProps({})` to force a re-render.


#### Returns

Expand Down
2 changes: 1 addition & 1 deletion docs/api/mount.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ A method that un-mounts the component.
A method that re-mounts the component.

#### [`.update() => ReactWrapper`](ReactWrapper/update.md)
Calls `.forceUpdate()` on the root component instance.
Syncs the enzyme component tree snapshot with the react component tree.

#### [`.debug() => String`](ReactWrapper/debug.md)
Returns a string representation of the current render tree for debugging purposes.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/shallow.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Returns a wrapper representing the `wrappingComponent`, if one was passed.
Returns the instance of the root component.

#### [`.update() => ShallowWrapper`](ShallowWrapper/update.md)
Calls `.forceUpdate()` on the root component instance.
Syncs the enzyme component tree snapshot with the react component tree.

#### [`.debug() => String`](ShallowWrapper/debug.md)
Returns a string representation of the current shallow render tree for debugging purposes.
Expand Down

0 comments on commit 3b3f808

Please sign in to comment.