Always Put the “Root” route at the bottom

This will be a simple and important one.I myself kind of find this small trick very useful. Let me explain it with an example Suppose you have defined your “Routes” like the following <Switch> <Route path="/" component={MainComponent}/> <Route path="/firstpath" component={FirstComponent}/> <Route path="/secondpath" component={SecondComponent}/> </Swith> In this case,React will not render

How to use Next.js with React

Couple of days back I came to know about a framework named “Next.js” which is being used with React app for sever-side rendering.As far it seems very promising and really easy to use.But,first thing first.First question came to my mind is that “What is server-side rendering?How is it differ from

The importance of callback in React setState

The setState function in React which is used to manipulate the state can take a callback. If your state look like this state={ key:value }; and you want to manipulate the state in somewhere in your React component and along with that you are making some api request where you

Why should you choose React for your next project?

Whenever you choose a new framework,the very first question come to your mind is why should i learn it? or how will it be beneficial to you? I will give you the shortest and well explained answer i can come up with. 1.SIMPLE AND EASY LEARNING React is very easy