Web / ReactJS Interview questions
What is the need for Babel in React?
Babel is a JavaScript compiler that includes the ability to compile JSX into regular JavaScript. Babel transpiles JSX to vanilla Javascript and also converts the ES6 code to a code that is compatible with the browsers.
Web browsers cannot read JSX directly because they are built to only read regular JS objects. For a web browser to read a JSX file, the file needs to be transformed into a regular JavaScript object for which we use Babel.
More Related questions...