react / react
React · React is a JavaScript library for building user interfaces.
React 是一个用于构建用户界面的 JavaScript 库。
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.
声明式:React 让创建交互式 UI 变得轻松。为应用程序的每个状态设计简单的视图,当数据发生变化时,React 将高效地更新并渲染出正确的组件。声明式视图使代码更具可预测性,更易于理解和调试。
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 the state out of the DOM.
组件化:构建管理自身状态的封装组件,然后将它们组合起来以制作复杂的 UI。由于组件逻辑是用 JavaScript 而非模板编写的,因此你可以轻松地在应用中传递丰富的数据,并将状态保留在 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. Learn how to use React in your project.
一次学习,随处编写:我们不对你的其余技术栈做任何假设,因此你可以在不重写现有代码的情况下使用 React 开发新功能。React 还可以使用 Node 在服务器端进行渲染,并使用 React Native 为移动应用提供支持。了解如何在你的项目中使用 React。
Installation: React has been designed for gradual adoption from the start, and you can use as little or as much React as you need: Use Quick Start to get a taste of React. Add React to an Existing Project to use as little or as much React as you need. Create a New React App if you’re looking for a powerful JavaScript toolchain.
安装:React 从一开始就被设计为可逐步采用,你可以根据需要使用少量的或大量的 React:使用“快速入门”来体验 React。将 React 添加到现有项目中,根据需要使用适量的 React。如果你正在寻找强大的 JavaScript 工具链,请创建一个新的 React 应用。
Documentation: You can find the React documentation on the website. Check out the Getting Started page for a quick overview. The documentation is divided into several sections: Quick Start, Tutorial, Thinking in React, Installation, Describing the UI, Adding Interactivity, Managing State, Advanced Guides, API Reference.
文档:你可以在网站上找到 React 文档。查看“入门”页面以获取快速概览。文档分为几个部分:快速入门、教程、React 哲学、安装、描述 UI、添加交互、管理状态、高级指南、API 参考。
Where to Get Support: Contributing Guide: You can improve it by sending pull requests to this repository.
获取支持:贡献指南:你可以通过向此仓库发送拉取请求(pull requests)来改进它。
Examples: We have several examples on the website. Here is the first one to get you started: import { createRoot } from ‘react-dom/client’; function HelloMessage({ name }) { return
示例:我们在网站上提供了几个示例。这是让你入门的第一个示例:import { createRoot } from ‘react-dom/client’; function HelloMessage({ name }) { return
Contributing: The main purpose of this repository is to continue evolving React core, making it faster and easier to use. Development of React happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving React.
贡献:此仓库的主要目的是继续发展 React 核心,使其更快、更易于使用。React 的开发在 GitHub 上公开进行,我们感谢社区为贡献错误修复和改进所做的工作。阅读下文以了解如何参与改进 React。
Code of Conduct: Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
行为准则:Facebook 已采用了一套我们期望项目参与者遵守的行为准则。请阅读全文,以便了解哪些行为是被允许的,哪些是不被容忍的。
Contributing Guide: Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to React.
贡献指南:阅读我们的贡献指南,了解我们的开发流程、如何提出错误修复和改进建议,以及如何构建和测试你对 React 所做的更改。
Good First Issues: To help you get your feet wet and get you familiar with our contribution process, we have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place to get started.
良好的首个议题:为了帮助你上手并熟悉我们的贡献流程,我们列出了一系列“良好的首个议题”,其中包含范围相对有限的错误。这是开始参与的好地方。
License: React is MIT licensed.
许可证:React 采用 MIT 许可证。