I have two .js files: root.js and external.js
root.js
import myExternalFunction from 'external.js'
class Parent {
constructor(){}
parentFunction = () => {
console.log('I was called from an external function using "this."')
}
}
external.js
export default myExternalFunction = () => {
this.parentFunction()
}
Currently I receive an error about it not being a function, or no access to 'this'.
How do I import external functions that want to use the 'this' scope from which they are being called?