【发布时间】:2021-09-20 15:40:31
【问题描述】:
所以这个错误对我来说有点神秘,我无法弄清楚如何解决它。
我有一个theme.ts 文件,大致如下所示:
import { AgnosticStyles, ThemeParameters } from 'styled-components';
import { createTheme } from '@material-ui/core/styles';
const agnosticStyles: AgnosticStyles = {
font: {
weight: {
light: '300',
normal: '400',
bold: '600',
},
},
};
...
// more themes
const defaultTheme = {
lightTheme,
darkTheme,
};
export default defaultTheme;
在我的Button.stories.txs 文件中,当我尝试导入它时以同样的方式导入其他所有内容...我在故事书中收到以下错误:
好的,所以我想我需要写theme.ts,但这有两件事。一,它会产生如下所示的错误,二,它会破坏 VsCode TS 附带的智能感知。
如何修复我的Button.stories.tsx 文件,以便消除导入路径错误,我可以导入为src/theme?
【问题讨论】:
标签: reactjs webpack next.js storybook