Onto a New Flavour of JS. . .

Onto a New Flavour of JS. . .

I’ve been learning Javascript for a month now and it's going great but it doesn’t have all the bells and whistles you get with using a framework. So although JS vanilla is lovely I think it’s time to move onto some new flavours in the JS world.

There’s around 24 JS frameworks out there and React.js ranks number one as people’s choice. React is actually a library (it states that right on their homepage) but sometimes it’s referred to as a framework, with that aside, it’s a great next step once comfortable with Vanilla Javascript. Here’s a few reasons why:

  1. It’s a small and light package installation and is quick and easy

  2. It’s pretty much javascript so the transition is pretty seamless.

  3. It’s declarative, you don’t have to state step by step HOW you want something to be performed, you just state WHAT you want to be done.

  4. It can reduce your code tremendously.

  5. Great for Frontend

  6. It’s component based, it allows you to break down your code into components and join them together to create a complex UI. You can reuse components in different parts of your code and change elements within components, as they are separated it doesn’t break your whole code.

  7. It’s faster, the use of components and virtual DOM improves performance

  8. Uses JSX (javascript syntax extension) which is like writing HTML in JS

  9. It is very intuitive; if an error occurs it spells out the issue it found in your code

  10. State and state hooks allow you to manage data and render a page when they change. State hooks now allow you to do this in functions and you don’t need to create classes making a lot easier to use.

After using React for only a week it is a breath of fresh air compared to Vanilla JS, my fingers have had a rest from typing so much, it is much easier to write and create code. It’s quicker finding areas of code I need to edit as I just go to the component instead of scrolling through 1000+ lines of code. And updating a page is easy with addition of hooks, useState is a charm. Here’s a link to learn more and try react out reactjs.org