Skip to content Skip to sidebar Skip to footer

Pass Options To Es6 Module Imports Not Working

Following this Stackoverflow question, I am trying to pass options to ES6 imports? This worked fine: export default (Param1:any, Param2:any) => { return class Foo {

Solution 1:

I think you should just export the classes separately:

exportclassFoo {
    constructor(Param1) {
        console.log(Param1);
    }
}

exportclassBar {
    constructor(Param1) {
        console.log(Param1);
    }
}

Then you can import like so:

import {Foo, Bar} from'./your/path/to/module.js

Post a Comment for "Pass Options To Es6 Module Imports Not Working"