Jennifer Fu
1 min readAug 29, 2020

--

import("./" + routeMapping[selected.value]).then((module) => {

setRoutes(module.currentRoutes);

});

In the above format to write dynamic importing, the module can be destructured.

--

--

Jennifer Fu
Jennifer Fu

No responses yet