Closed EddyVinck closed 6 years ago
@EddyVinck , it is not the exact same code.
In the working code the displayName
is applied to the Wrapper
element before being passed to React.forwardRef
while in your code you apply the displayName
to the returned object so it is not associated with the actual component that gets rendered. You could log the Wrapper
variable in both cases and you will see the difference.
Thank you for looking into this. I will post an update when I work on this course again, which is probably this weekend or earlier.
Thanks @gpetrioli!
I stumbled upon something. My code for the HOC matches the code in the video, but the tests still fail. The code in /exercises-final is different and passes the tests. Why? Did the hoistNonReactStatics API change?
My code:
The code above is the exact same code as in the course (FEM) but the tests are still failing. What's going on?
The code in /exercises-final
This is what the tests are saying: