Исходный код:
const StyledHorizontalRule = styled.hr`
border: 1px solid;
color: ${props => props.theme.palette.divider_inverted };
width: auto;
`;
export const HorizontalRule = () => <StyledHorizontalRule />;
и способ импортирования компонента:
import { HorizontalRule } from '../../../ui-elements-layout/components/HorizontalRule/index';
Я получил:
[!] Error: Unexpected token (Note that you need plugins to import
files that are not JavaScript)
../ui-elements-layout/components/HorizontalRule/HorizontalRule.tsx
(10:36)
8: `;
9:
10: export const HorizontalRule = () => <StyledHorizontalRule />;
^
Как экспортироватьКомпонент правильно, каковы оптимальные методы, чтобы сделать это?
РЕДАКТИРОВАТЬ: index.ts
имеет:
export * from './HorizontalRule';