blog podcast

React

I’ve really been wanting to get in touch with React for a long time. Before I went on parental leave I had a small encounter with it, but now I’m finally getting the chance to dig a bit deeper into it.

I quite like the framework, as I’m in general a fan of the pricipal that a library should be doing one thing, and do it well. What sometimes confuses me is this whole .jsx/tsx thing and what is happening under the hood. That’s where I notice I’m struggling with sometimes as well when it comes to effects etc.. I have the feeling sometimes that react is really nice when it works, and when it doesn’t it can be quite annoying. This is also true when it comes to testing. As I always try to work test driven I encounter issues from time to time. One thing I found with enzyme, which is a library that helps to mount react components and render them, is that it has a .debug() function on the objects it renders. This is super useful to log when you are confused about what is happening.

Code of the Day

console.log(wrapper.debug());