Home > Web Front-end > JS Tutorial > Can vue and react be run without babel?

Can vue and react be run without babel?

藏色散人
Release: 2022-12-30 11:12:35
Original
1788 people have browsed it

Vue and react cannot be run without babel, because the written code needs to be compiled with babel before the browser can recognize it; the compiled vue and react can be run without babel because their code has been processed by babel Converted.

Can vue and react be run without babel?

The operating environment of this tutorial: windows7 system, react17.0.1&&vue2.0 version, Dell G3 computer.

Recommended: "JS Basic Tutorial"

Can vue and react be run without babel?

You cannot run vue and react without babel during development, because the written code needs to be compiled with babel before the browser can recognize it; the compiled vue and react can run without babel because their code has been Converted through babel.

Babel is a JavaScript compiler, that is, when you use the latest JavaScript syntax, Babel converts it into browser-compatible JavaScript code through a syntax converter. This allows us to use the new syntax immediately without waiting for browser support.

For example:

// 下一代 JavaScript 语法
[1,2,3].map(n => n+1);
 
// babel转换为浏览器兼容的 JS 代码
[1,2,3].map(function(n){
    return n+1;
});
Copy after login

The above is the detailed content of Can vue and react be run without babel?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template