J4v4Scr1pt
J4v4Scr1pt

Reputation: 303

'...' expected.ts(1005) and No overload matches this call

Hello fellow programmers 😁!

After a day of setting up React app with TypeScript, webPack, Babel, ESLint, Styled Components etc. I am so close..

I am stuck with two errors and I cant reslove them... Can some awesome person out there point me in the right direction 😊.

For the first issue I have followed this guide without result 😑: https://binyamin.medium.com/using-typescript-with-styled-components-35950e196e9c

First issue: enter image description here enter image description here

Second Issue: enter image description here

eslintrc:

enter image description here

tsconfig:

enter image description here

Upvotes: 0

Views: 1341

Answers (2)

J4v4Scr1pt
J4v4Scr1pt

Reputation: 303

Second Issue was solved by creating a type that only contained the prop needed in the wrapper class:

interface IWrapperTypes {
    appearance: "success" | "warning" | "info" | "danger" | "notification";
}

type WrapperTypes = IWrapperTypes;
const Wrapper = styled.div<WrapperTypes> //....

Upvotes: 0

Dennis Vash
Dennis Vash

Reputation: 53914

Its just a syntax error, read more about JSX in depth. Check prettier output.

<>
  <Wrapper appearance={appearance} />
  <Alert label="Hello" appearance="info" />
  // same ("... expected")
  <Wrapper {...{ appearance }} />
  <Alert {...{ label: "Hello", appearance: "info" }} />
</>

Upvotes: 1

Related Questions