I split my components into two files. Index.tsx and Style.js. I keep my styles in Style.js to keep the index file clean.
When I try to import my styled component from Style.js i get the following error:
Could not find a declaration file for module './Style'. '/Users/sjoerdvermeijden/Sites/react-vite-typescript-todo/src/components/Footer/Style.js' implicitly has an 'any' type.
This is what the import looks like:
import { FooterWrapper } from "./Style";
This is what the styles look like:
import styled from "styled-components";
export const FooterWrapper = styled.div`
padding: 25px 0;
background: var(--darkgray);
color: white;
`;
These are the modules i have installed to get styled components working:
npm i -D @types/styled-components
npm i styled-components