I have a function in a .react.js file that works fine in that file that imports as undefined in a different file.
So in in file1.react.js:
const functionName= function (): React.Node {
return (
<// insret code here>
);
};
export default functionName;
and in file2.react.js:
import {functionName} from 'file1.react'
But when I try to call {functionName()} it says functionName isn't a function and when I do {typeof functionName} it says it's undefined.
FYI: I referenced question 43262599 and 54199264 when trying to get this to work.
I guess this pictures is self-explanatory and will help you to know where you are going wrong

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