I am creating a styled-components with Atomic Design and I want to separate styled files into one folder and have one index.js to export all files. I have found that can be done like this way: Splitting Styled-Components into multiple files but export them as one file but In my case when I want to export file inside index.js
export StyledClosestMeet from 'styledComponents/StyledClosestMeet.js';
I have error
Declaration or statement expected.ts(1128)
Inside styledComponents folder I have second file:
import styled from 'styled-components';
import variables from 'settings/variables';
const StyledClosestMeet = styled.div`
color: ${variables.colorMain};
font-size: 2rem;
font-weight: bold;
text-transform: uppercase;
`;
And later I want to import that file inside Atom file:
import React from 'react';
import {StyledClosestMeet} from 'styledComponents/StyledClosestMeet';
const ClosestMeet = () => {
return <StyledClosestMeet>Najbliższe spotkanie</StyledClosestMeet>;
};
export default ClosestMeet;
I am using jsconfig "baseUrl": "./src"