Aaron Mc Adam

Delivering user delight with Clean Code

Give JSX a Chance

The first time I saw React’s JSX, I felt sick. I thought it went against all the principles of separation of concerns I’ve followed for years. It put me off looking at anything else about React.

One day I got an email about from Web Bos about his new React for Beginners video course, having watched his great Flexbox series the week before. I decided to put aside my initial dismissal of React and give it an honest go. So, I signed up and started watching.

Initially, when I saw that there was an API to create elements without JSX, I was a bit happier. But then I started to realise that it provides a really simple abstraction for creating component trees.

For the past year I’ve been applying a component-based design to my CSS and HTML with BEM and my back end with Rails engines, so React is a natural extension of that. Everything I’ve learned so far has been pretty awesome and I’m looking forward to building apps with it.

The moral of the story is the old adage “don’t knock it til you try it”.

I think we need to remember to try out new ideas without dismissing them out of hand.