reactjs - Dynamically loading React components in WebStorm -
i can not resolve conf error when loading react component dynamically while using webstorm.
this component loading code using.
const req = require.context('.', true, /^(?!.\/index).*.js$/); req.keys().foreach(key => { const componentname = key.replace(/^.+\/([^/]+)\.js/, '$1'); module.exports[componentname] = req(key).default; });
it's loading code.
import { register } 'components';
is there way avoid unsolve errors in webstorm?
error picture:
Comments
Post a Comment