导出WebStorm中未使用的默认值

时间:2019-02-14 09:26:09

标签: reactjs npm webstorm react-loadable

我在React中使用loadable来动态加载我的组件。因此,我正在导出每个组件的索引,并将它们导入到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

1 个答案:

答案 0 :(得分:3)

登录为WEB-37294,请对其进行投票以使其在固定后得到通知