Skip to content

Commit

Permalink
DataViews: prevent unnecessary renders for Pagination (#57454)
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal authored Dec 29, 2023
1 parent 2888084 commit 2dbd8a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/dataviews/src/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import {
__experimentalHStack as HStack,
SelectControl,
} from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { createInterpolateElement, memo } from '@wordpress/element';
import { sprintf, __, _x } from '@wordpress/i18n';
import { chevronRight, chevronLeft } from '@wordpress/icons';

function Pagination( {
const Pagination = memo( function Pagination( {
view,
onChangeView,
paginationInfo: { totalItems = 0, totalPages },
Expand Down Expand Up @@ -91,6 +91,6 @@ function Pagination( {
</HStack>
)
);
}
} );

export default Pagination;

0 comments on commit 2dbd8a5

Please sign in to comment.