You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
I got a ts error as below:
`ERROR in src/components/UserSearch/test.tsx:18:12
TS2322: Type 'Dispatch<SetStateAction>' is not assignable to type 'LegacyRef | undefined'.
Type 'Dispatch<SetStateAction>' is not assignable to type '(instance: HTMLDivElement | null) => void'.
Types of parameters 'value' and 'instance' are incompatible.
Type 'HTMLDivElement | null' is not assignable to type 'SetStateAction'.
Type 'HTMLDivElement' is not assignable to type 'SetStateAction'.
Type 'HTMLDivElement' provides no match for the signature '(prevState: null): null'.
16 |
17 |
when I run the official example https://popper.js.org/react-popper/v2/
import React, { useState } from 'react';
import { usePopper } from 'react-popper';
const Example = () => {
const [referenceElement, setReferenceElement] = useState(null);
const [popperElement, setPopperElement] = useState(null);
const [arrowElement, setArrowElement] = useState(null);
const { styles, attributes } = usePopper(referenceElement, popperElement, {
modifiers: [{ name: 'arrow', options: { element: arrowElement } }],
});
return (
<>
Reference element
);
};
I got a ts error as below:
`ERROR in src/components/UserSearch/test.tsx:18:12
TS2322: Type 'Dispatch<SetStateAction>' is not assignable to type 'LegacyRef | undefined'.
Type 'Dispatch<SetStateAction>' is not assignable to type '(instance: HTMLDivElement | null) => void'.
Types of parameters 'value' and 'instance' are incompatible.
Type 'HTMLDivElement | null' is not assignable to type 'SetStateAction'.
Type 'HTMLDivElement' is not assignable to type 'SetStateAction'.
Type 'HTMLDivElement' provides no match for the signature '(prevState: null): null'.
16 |
17 |
Who can tell me what to do? thx~
The text was updated successfully, but these errors were encountered: