Skip to content

Commit

Permalink
Add an explainer comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed May 5, 2022
1 parent 7b3013b commit 84d52c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/data/src/components/use-select/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,8 @@ describe( 'useSelect', () => {
const rendered = render( <App multiple={ 1 } /> );
expect( rendered.getByRole( 'status' ) ).toHaveTextContent( 1 );

// Check that the most recent value of `multiple` is used to render:
// the old callback wasn't memoized and there is no stale closure problem.
rendered.rerender( <App multiple={ 2 } /> );
expect( rendered.getByRole( 'status' ) ).toHaveTextContent( 2 );
} );
Expand Down

0 comments on commit 84d52c9

Please sign in to comment.