Skip to content

Commit f6514b8

Browse files
authored
Minor clarification.
1 parent 554b75c commit f6514b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: docs/options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ A Promise instance which has already started. It will simply add the necessary r
3535
3636
A function that returns a promise. It is automatically invoked in `componentDidMount` and `componentDidUpdate`. The function receives all component props \(or options\) and an AbortController instance as arguments.
3737

38-
> Be aware that updating `promiseFn` will trigger it to cancel any pending promise and load the new promise. Passing an arrow function will cause it to change and reload on every render of the parent component. You can avoid this by defining the `promiseFn` value **outside** of the render method. If you need to pass variables to the `promiseFn`, pass them as additional props to `<Async>`, as `promiseFn` will be invoked with these props. Alternatively you can use [memoization](https://github.com/alexreardon/memoize-one) to avoid unnecessary updates.
38+
> Be aware that updating `promiseFn` will trigger it to cancel any pending promise and load the new promise. Passing an inline (arrow) function will cause it to change and reload on every render of the parent component. You can avoid this by defining the `promiseFn` value **outside** of the render method. If you need to pass variables to the `promiseFn`, pass them as additional props to `<Async>`, as `promiseFn` will be invoked with these props. Alternatively you can use `useCallback` or [memoize-one](https://github.com/alexreardon/memoize-one) to avoid unnecessary updates.
3939
4040
## `deferFn`
4141

0 commit comments

Comments
 (0)