I'm writing a react app, with mobx and framework7, and using code splitting in some of my imports, and I haven't found anything on this, but i want to know if there's a way for me to use a variable inside a import, something like this code:
const Slider = import("../parts/Slider").then( Slider =>
<Slider>
{
//sources would be an array of urls
sources.map( (source, i,) =>
<div className="slider" key={i} style={{position:'relative'}}>
<img className="picture" src={source} alt=""/>
</div>
)
}
</Slider>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.4.1/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.4.1/umd/react-dom.production.min.js"></script>