Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Pagination component return type #1635

Merged
merged 1 commit into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Changed `Pagination` type from `ReactNode` to `ReactElement | null` to prevent a clash with React 18 types.
Changed `Pagination` return type from `ReactNode` to `ReactElement | null` to prevent a clash with React 18 types.

Copy link
Member

Choose a reason for hiding this comment

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

Aaah, Kodiak was too fast 😅

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