DEV Community

Discussion on: How to test High Order Components in React

Collapse
 
papaponmx profile image
Jaime Rios • Edited

The reason why I include checks for render, componentWillMount, etc. Is just for consistency. Now that you have mentioned it, I'm not sure if they are necessary at all.

The import in the last test file, it should be Auth.js. In my pet project everything lives in a container folder. You can check out the react-boilerplate repo, to see a more complete implementation of the same pattern.

Collapse
 
kepta profile image
Kushan Joshi • Edited

Imho they aren't necessary and also do not make sense, since any reader like me would mistakingly read that this component expects props render, componentWillMount, which conflicts with React API.

Thread Thread
 
papaponmx profile image
Jaime Rios • Edited

You are right, I've just edited the post and my source code.

Thanks for the feedback.