Skip to content

Commit

Permalink
fix(button): fix error Button cannot be used as a JSX component
Browse files Browse the repository at this point in the history
Fix error after updating to v0.6.0 Button cannot be used as a JSX component. Its return type
'ReactNode' is not a valid JSX element.

fix themesberg#962
  • Loading branch information
congon4tor committed Sep 18, 2023
1 parent db8d492 commit a359614
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/generic-forward-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { forwardRef } from 'react';

// eslint-disable-next-line @typescript-eslint/ban-types
type FixedForwardRef = <T, P = {}>(
render: (props: P, ref: React.Ref<T>) => React.ReactNode,
) => (props: P & React.RefAttributes<T>) => React.ReactNode;
render: (props: P, ref: React.Ref<T>) => JSX.Element,
) => (props: P & React.RefAttributes<T>) => JSX.Element;

const genericForwardRef = forwardRef as FixedForwardRef;

Expand Down

0 comments on commit a359614

Please sign in to comment.