Reputation: 303
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
eslintrc:
tsconfig:
Upvotes: 0
Views: 1341
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
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