导出默认值未在WebStorm中使用

问题描述 投票:3回答:1

我在React中使用可加载来动态加载我的组件。所以我正在导出每个组件的索引并将它们导入app.js.但问题是我在WebStorm中仍然遇到错误,即导出默认值在单个组件索引文件中未使用。

这是我的代码。这是在我的App.js文件中。

const HomeIndex = Loadable({
loader: () => import('./components/home/Index'),
loading: () => <div> </div>,
 });

我的组件索引文件。

export default class HomeIndex extends React.Component {

fetchCounts = () =>{
    this.counts.fetchCounts();
};

render(){
    return(
        <div className="pageView">
            <Counts ref={refs => { this.counts = refs; }}/>
            <hr/>
            <Customers fetchCounts={this.fetchCounts}/>
        </div>
    )
  }
}

WebStorm中的错误屏幕截图:

enter image description here

reactjs npm webstorm react-loadable
1个回答
3
投票

记录为WEB-37294,请投票给它,以便在修复时得到通知

© www.soinside.com 2019 - 2024. All rights reserved.