After coming across this Stackoverflow thread, I am attempting to pass options to ES6 imports.
Initially, this code worked without any issues:
export default (Param1:any, Param2:any) => {
return class Foo {
constructor() {
console.log(Param1);
}
}
}
However, I now require to return more than one class, so I made the following adjustments:
export default (Param1: any, Param2: any)=>{
class Foo {
constructor() {
console.log(Param1);
}
}
class Bar {
constructor() {
console.log(Param1);
}
}
return {Foo, Bar}
}
Upon compilation, I encountered the following error:
TS4060: Return type of exported function has or is using private name Foo TS4060: Return type of exported function has or is using private name Bar
Any suggestions on how to successfully pass options to ES6 imports importing multiple classes?