HOC is not a function

105 views Asked by At

I am trying to implement a simple HOC in REACT but for some reason, this error keeps popping up.

(0, _hocFunctionName.hocFunctionName) is not a function

here is a link to the sandbox HERE

I am not sure what is the problem and I searched for what might be wrong but haven't found a solution...

1

There are 1 answers

2
Nicholas Tower On BEST ANSWER

You're exporting using a default export, but then trying to import using a named import. They'll need to either both be default, or both be named.

So either change the import to:

import withFallOut from "./withFallout";

Or change the export to:

export function withFallOut(WrappedComponenet) {