React是什么

来源:互联网 发布:淘宝充值平台不能用了 编辑:程序博客网 时间:2024/05/19 16:48

React是什么?

Facebook官方说明

原文

React is a JavaScript library for building user interfaces.
- Declarative: React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes. Declarative views make your code more predictable, simpler to understand, and easier to debug.
- Component-Based: Build encapsulated components that manage their own state, then compose them to make complex UIs. Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.
- Learn Once, Write Anywhere: We don’t make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code. React can also render on the server using Node and power mobile apps using React Native.

译文

React是一个用于构建用户界面的JavaScript库。

  • 声明式:React使得创建交互式UI无痛。为您的应用程序中的每个状态设计简单的视图,当您的数据更改时,React将有效地更新和呈现正确的组件。声明式视图使您的代码更可预测,更易于理解,并易于调试。
  • 基于组件:构建管理自己的状态的封装组件,然后组合它们以创建复杂的UI。由于组件逻辑是用JavaScript而不是模板编写的,因此您可以轻松地通过应用程序传递丰富的数据,并将状态保留在DOM之外。
  • 学习一次,随地编写:我们不对您的技术堆栈的其余部分做出假设,因此您可以在React中开发新功能,而无需重写现有的代码。React也可以在使用Node的服务器上和强大的移动应用上使用React Native渲染。

简而言之,React是一套UI引擎,是DOM的抽象层,并不是Web应用的完整解决方案。没涉及代码结构组件之间的通信

百度百科

React 起源于 Facebook 的内部项目,因为该公司对市场上所有 JavaScript MVC 框架,都不满意,就决定自己写一套,用来架设Instagram 的网站。做出来以后,发现这套东西很好用,就在2013年5月开源了。

特点:
1. 声明式设计:React采用声明范式,可以轻松描述应用。
2. 高效:React通过对DOM的模拟,最大限度地减少与DOM的交互。
3. 灵活:React可以与已知的库或框架很好地配合。

原创粉丝点击