Inferno has the same concepts as React because it was heavily inspired from React but with the aim from its start to build an improved react like user interface library which has :
– Better performance than React especially for mobile apps .
– Smaller size .it’s around 9kb which means it’s faster to transfer and to parse.
Can be rendered in client and server.
– Blazing and extremely fast UI library. Actually Inferno can render on both the client and server and at the time of writing. It’s the fastest user interface library in existence today.
– Inferno is an unopinionated UI library which means you have the choice to use and structure your project as you like. The library doesn’t get in the way and in the same time offers you the tools necessary to reinvent the wheel.
– An inferno-compat package allows developers to switch existing React projects to Inferno in just a few lines of code.
-There is a growing set of Inferno packages available, such as inferno-redux, inferno-mobx, inferno-router, and more.
– Inferno give high performance library can solve many problems related to :
- Battery time
- Memory consumption
- And general performance
Inferno JS Features:
Inferno has all the features of react plus performance related features .Now lets see a bunch of them
- Component driven, one-way data flow architecture.
- Partial synthetic event system.
- A link Event feature, which removes the need for arrow functions or binding event callbacks.
- Inferno is an isomorphic library if you don’t what this .It’s simply rendering on both the server and the client which is good for SEO.
- Inferno has Lifecycle events on functional components.
- Inferno has Controlled components for input/select/textarea elements.
Unopinionated and highly modular which doesn’t make any restrictions on how you can structure your project built using Inferno .
How to create your first Inferno application:
Getting started with Inferno is easy and straightforward thanks to create-inferno-app which is a port of Create React App .
So open up your terminal on Linux and MAC or your command prompt on Windows then install create-inferno-app from the command line interface via npm .
npm install -g create-inferno-app
You realize that you need Node.js installed on your local system if you want to be able to use Inferno build system .So if it is not installed start by installing the latest version of Node.js .Go to Node.js (with npm) official website Node.js website and grab an installer for your OS .You can also use NVM or Node Version Manager to install it
Next you need to create an Inferno App .Again from the CLI enter :
Last , just cd into your app folder and npm start
you have created your first Infero app quickly.
Now just visit http://localhost:3000/ with your browser to see your app in action.
Install Bootstrap CSS
To style our components quickly, let’s use Bootstrap. We use npm to install Bootstrap:
$ npm install bootstrap@3 –save
Import the Bootstrap CSS file in the src/index.js file to make it available in the application:
After developing your app .If you are ready for production then just run
npm run build
To produce the production version of your app .
Now let’s test a small example .Open up src/App.js file with your favorite text editor delete everything and add the following c<span style="font-w