Skip to content

Commit

Permalink
DataViews: prevent unnecessary renders for Pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Dec 29, 2023
1 parent af8c530 commit cb49e91
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 cb49e91

Please sign in to comment.