diff --git a/.changeset/olive-parents-search.md b/.changeset/olive-parents-search.md new file mode 100644 index 00000000000..8a9bf101612 --- /dev/null +++ b/.changeset/olive-parents-search.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +Token: Omit `onResize` and `onResizeCapture` methods that are included in the method expansion and causes type issues in React 18 diff --git a/src/Token/Token.tsx b/src/Token/Token.tsx index b85191ffad9..6a4569ddc2a 100644 --- a/src/Token/Token.tsx +++ b/src/Token/Token.tsx @@ -6,7 +6,9 @@ import TokenBase, {defaultTokenSize, isTokenInteractive, TokenBaseProps} from '. import RemoveTokenButton from './_RemoveTokenButton' import TokenTextContainer from './_TokenTextContainer' -export interface TokenProps extends TokenBaseProps { +// Omitting onResize and onResizeCapture because seems like React 18 types includes these menthod in the expansion but React 17 doesn't. +// TODO: This is a temporary solution until we figure out why these methods are causing type errors. +export interface TokenProps extends Omit { /** * A function that renders a component before the token text */