Many people argue that React is not a beginner friendly framework due to its complexity. Their criteria for judging is usually based on certain myths that freely roam around React ecosystem. In this short article, we will discuss and demystify five common myths that are associated with React. So let's start our short journey!
Myth one: React is a framework
Myth two: React can’t be used as a <script> tag
Well, it can, but it shouldn't. Theoretically, you can load React in the <script> tag, but it is not considered as a good practice unless you are just testing out a few things and exploring the library for the very first time. If you want to, you can do it by including React and React-DOM packages. Including React is an obvious step and including React-DOM means you want your React application to run inside the browser (hint: React can run on other platforms as well).
Myth three: React is hard to set up
Myth four: If you want JSX, you need Webpack
Myth five: Redux is mandatory for dealing with an application state
No, it is not. Should you use it? - It depends. Redux is a tool for managing application state. If you’re learning React, don’t mix Redux with your first application - learn to think the React way. According to Dan Abramov (creator of Redux), you should only add Redux when you feel that something is wrong with your application's state. In that way, you will clearly understand why it is better to have a single source of truth for your data instead of storing everything inside components’ state. Many people fall into the trap of adding Redux way too early to their application when it doesn't solve any problems and adds an extra layer of complexity. Don't be one of them.