Skip to content

Commit

Permalink
Fix Pagination component return type (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Métral authored Jun 30, 2022
1 parent 5e4a9e7 commit 5c2ea97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-mails-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/circuit-ui': patch
---

Changed `Pagination` type from `ReactNode` to `ReactElement | null` to prevent a clash with React 18 types.
4 changes: 2 additions & 2 deletions packages/circuit-ui/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { ReactNode } from 'react';
import { ReactElement } from 'react';
import { css } from '@emotion/react';
import { Theme } from '@sumup/design-tokens';
import { ChevronLeft, ChevronRight } from '@sumup/icons';
Expand Down Expand Up @@ -102,7 +102,7 @@ export const Pagination = ({
totalLabel,
tracking = {},
...props
}: PaginationProps): ReactNode => {
}: PaginationProps): ReactElement | null => {
if (
process.env.NODE_ENV !== 'production' &&
process.env.NODE_ENV !== 'test'
Expand Down

1 comment on commit 5c2ea97

@vercel
Copy link

@vercel vercel bot commented on 5c2ea97 Jun 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.