I want to dynamically import a react js module. The module is not component it is an object of data, so I cannot use react code splitting. In the webpack docs there is an example with a promise. When I use it like that in a react component, it throws an error because the component tries to render before the promise hadd been resolved. I want to import it in that way in case the data does not exist, I could provide default data.
const dataProps = import(`./dataObject.js`).then(data=> data);
...
render() {
<SomeComponente data={data} />
}