In react, there comes a point when a new developer might ask, where does HTML play a part in building an application using react? Well, writing html is not a viable option in react. THen how can we build a web page if there is no html?
The answer is simple, using JSX. JSX stands for javascript xml . Javascript xml is used as an alternative of html in a react application. JSX is almost like html except that it's not. The syntax and everything is just like html, which means writing jsx and writing html is almost no different. The difference comes in parsing them. Html is directly parsed by the browser whereas jsx is parsed and converted into javascript first, and then it is counted as javascript by the parser.
In earlier days, the babel transpiler was needed for this parsing task of xml, but nowadays in react it is done easily using the babel plugin so that external babel transpiler is no longer needed.
Top comments (0)