TypeScript is JavaScript with syntax for types. TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
How to reproduce it
const eventProps = { setEventType, eventOptions};
<EventOptions {...eventProps}></EventOptions>
export function EventOptions(setEventType: React.Dispatch<React.SetStateAction<string>>, eventOptions: React.RefObject<HTMLDivElement>): ReactElement {
...
return <></>;
}
Error
TS2322: Type '{ setEventType: Dispatch<SetStateAction<string>>; eventOptions: RefObject<HTMLDivElement>; }' is not assignable to type 'Dispatch<SetStateAction<string>>'.
Type '{ setEventType: Dispatch<SetStateAction<string>>; eventOptions: RefObject<HTMLDivElement>; }' provides no match for the signature '(value: SetStateAction<string>): void'.
Solution
Update definition of parameters .
export function EventOptions({ setEventType, eventOptions }: { setEventType: React.Dispatch>; eventOptions: React.RefObject }): ReactElement {
…
return <></>;
}