Skip to main content

Posts

Showing posts from December, 2019

ReactJS - why, what and what not

ReactJs is a JavaScript library for building user interfaces. React focuses only on V (view) layer of MVC applications. Here are some features specific to react: JSX -  A combination of both JavaScript and HTML used to render UI elements.  Even though it's usage is not mandatory within react apps, it is recommended to use this as React considers building and rendering UI components an integral part of JS as we have event handlers, listeners e.t.c.. JSX is just react friendly way of defining your HTML within JavaScript code as under the hood it uses regular JavaScript functions to render. Here is an example comparing JSX code and JavaScript code to create the same element: JSX: const heading = < h1 className = " main-titles " > Hello , React < / h1 > Without JSX: const heading = React . createElement ( ' h1 ' , { className : ' main-titles ' } , ' Hello, React ' ...