Skip to content

Commit 3b3f808

Browse files
Lukas Kullmannljharb
authored andcommitted
[Docs] mount/shallow: update: fix semantics description
Fixes #1405
1 parent 4cad446 commit 3b3f808

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

docs/api/ReactWrapper/update.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# `.update() => Self`
22

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

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

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

911
#### Returns
1012

docs/api/ShallowWrapper/update.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# `.update() => Self`
22

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

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

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

911
#### Returns
1012

docs/api/mount.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ A method that un-mounts the component.
192192
A method that re-mounts the component.
193193

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

197197
#### [`.debug() => String`](ReactWrapper/debug.md)
198198
Returns a string representation of the current render tree for debugging purposes.

docs/api/shallow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Returns a wrapper representing the `wrappingComponent`, if one was passed.
200200
Returns the instance of the root component.
201201

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

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

0 commit comments

Comments
 (0)