Skip to content

Commit

Permalink
docs(API): mention memoized value
Browse files Browse the repository at this point in the history
  • Loading branch information
oklas committed Feb 12, 2020
1 parent 1ef821b commit 14a6438
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/API/createAdvAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ one of
const Agent = createAgent('myarea', 'id')
const AdvAgent = createAdvAgent('myarea', 'id')

const memoized = React.useMemo({}, [])

<div>
<Through area='myarea'>
{(area) => {
Expand All @@ -63,6 +65,9 @@ const AdvAgent = createAdvAgent('myarea', 'id')

good: because there is no props with new instance
<AdvAgent area='myarea' data='' />

good: because memoized value is used
<AdvAgent area='myarea' data={memoized} />
</div>
}
</Through>
Expand Down

0 comments on commit 14a6438

Please sign in to comment.