diff --git a/docs/API.md b/docs/API.md index 588e857b4..53ba8dca3 100644 --- a/docs/API.md +++ b/docs/API.md @@ -98,7 +98,9 @@ A method returning an array of `ReactTestInstance`s with matching a React compon ### `update: (element: React.Element) => void` -Re-render the in-memory tree with a new root element. This simulates a React update at the root. If the new element has the same type and key as the previous element, the tree will be updated; otherwise, it will re-mount a new tree. +Re-render the in-memory tree with a new root element. This simulates a React update at the root. If the new element has the same type and key as the previous element, the tree will be updated; otherwise, it will re-mount a new tree. This is useful when testing for `componentDidUpdate` behavior, by passing updated props to the component. + +[Example code](https://github.com/callstack/react-native-testing-library/blob/f96d782d26dd4815dbfd01de6ef7a647efd1f693/src/__tests__/act.test.js#L31-L37) ### `unmount: () => void`