When using dynamic imports, can I define what I want to import like regular imports?
For example:
import Person from '/classes.js'
As dynamic:
await import('Person from /classes.js') //Incorrect obviously
Dynamic imports will hand you everything from within the module. You can use destructuring the extract the pieces you want.
const { Person } = await import('/classes.js');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With