reactnativecn/react-native-website — dự án mã nguồn mở — đang có 232 sao GitHub. React Native 中文网
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This repo contains the website configuration and documentation powering the React Native website.
If you are looking for the source code of the React Native Archive website select the archive branch.
Contents
Getting started
Overview
Website configuration
Contributing
License
✈️ Getting started
Prerequisites
Git.
Node (version 22 or greater).
Yarn Classic (version 1).
A fork and clone of the react-native-website repo (for any contributions).
Installation
cd react-native-website to go into the project root.
Run yarn to install the website's workspace dependencies.
Running locally
Run yarn start to start the development server (powered by Docusaurus).
Open http://localhost:3000/ site in your favorite browser.
📖 Overview
If you would like to contribute an edit or addition to the docs, read through our style guide before you write anything.
Almost all our content is generated from markdown files you can find in the docs, website/architecture and website/contributing directories.
To edit the internals of how the site is built, you may want to get familiarized with how the site is built. The React Native website is a static site generated using Docusaurus.
The website configuration can be found in the website directory. Visit the Docusaurus website to learn more about all the available configuration options.
Directory Structure
The following is a high-level overview of relevant files and folders.
As mentioned above, the docs folder contains the source files for docs from "Guides", "Components" and "APIs" tabs on the React Native website (versioned docs).
The doc files for the "Architecture" and "Contribution" tabs are located inside website in the respective directories (unversioned/static docs).
In most cases, you will only want to edit the files within those directories.
If you're adding a new doc or you need to alter the order the docs appear in the sidebar, take a look at the sidebars.ts, sidebarsArchitecture.ts and sidebarsContributing.ts files in the website directory. The sidebar files contain a list of document ids that should match those defined in the header metadata (aka frontmatter) of the docs markdown files.
Versioned docs
Part of the React Native website is versioned to allow users to go back and see the Guides or API reference documentation for any given release. A new version of the website is generally generated whenever there is a new React Native release. When this happens, any changes made to the docs and website/sidebars.ts files will be copied over to the corresponding location within website/versioned_docs and website/versioned_sidebars.
[!NOTE]
Do not edit the auto-generated files within versioned_docs or versioned_sidebars unless you are sure it is necessary. Edits made to older versions will not be propagated to newer versions of the versioned docs.
Docusaurus keeps track of the list of versions for the site in the website/versions.json file. The ordering of versions in this file should be in reverse chronological order.
Cutting a new version
After RC
The React Native website lints and typechecks documents in "next". The version of React Native used by the linter should be updated before a release for consistency and to catch any documents/examples where APIs have changed.
This can be done by updating the package.json and configuration files in script/lint-examples the same way a React Native application would be updated. The diff of these files can be seen using a tool like React Native Upgrade Helper.
After Release
cd react-native-website to go into the project root.
cd website to go into the website portion of the project.
Run yarn version:cut <newVersion> where <newVersion> is the new version being released (e.g. 0.81).
Open a PR and commit this change as "Cut branch "
🔧 Website configuration
The main config file for the website can be found at website/docusaurus.config.ts. This file tells Docusaurus how to build the website. Edits to this file are rarely necessary.
The core subdirectory contains JavaScript and React components that are the core part of the website.
The src/pages subdirectory contains the React components that make up the non-documentation pages of the site, such as the homepage.
The src/theme subdirectory contains the swizzled React components from the Docusaurus theme.
The showcase.json file contains the list of users that are highlighted in the React Native showcase.
👏 Contributing
Create a branch
git checkout main from any folder in your local react-native-website repository.
git pull origin main to ensure you have the latest main code.
git checkout -b the-name-of-my-branch to create a branch.
replace the-name-of-my-branch with a suitable name, such as update-animations-page
Make the change
Follow the "Running locally" instructions.
Save the files and check in the browser.
Some changes may require a server restart to generate new files. (Pages in docs always do!)
Edits to pages in docs will only be visible in the latest version of the documentation, called "Next", located under the docs/next path.
Visit http://localhost:3000/docs/next/YOUR-DOCS-PAGE to see your work.
[!NOTE]
Visit http://localhost:3000/versions to see the list of all versions of the docs, if you have backported some of the changes.
[!TIP]
If you're adding assets, make sure they’re optimized for the web. You can use tools like ImageOptim to automatically apply lossless compression to various file types.
Test the change
If possible, test any visual changes in all latest versions of the following browsers:
Chrome and Firefox on the desktop.
Chrome and Safari on mobile.
Push it
Run yarn lint and yarn prettier in ./website directory to ensure your changes are consistent with other files in the repo.
Run yarn update-lock to deduplicate dependencies.
git add -A && git commit -m "My message" to stage and commit your changes.
replace My message with a commit message, such as Fixed header logo on Android
git push my-fork-name the-name-of-my-branch
Go to the react-native-website repo and you should see recently pushed branches.
Follow GitHub's instructions.
Describe briefly your changes (in case of visual changes, please include screenshots).
📄 License
React Native is MIT licensed.
React Native documentation is Creative Commons licensed.
Đọc thêm về reactnativecn/react-native-website ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/reactnativecn/react-native-website là nguồn chính thức.
reactnativecn/react-native-website có bao nhiêu sao?
reactnativecn/react-native-website có 232 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/reactnativecn/react-native-website. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
reactnativecn/react-native-website có phải mã nguồn mở không?
Có — reactnativecn/react-native-website phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/reactnativecn/react-native-website.
reactnativecn/react-native-website còn đang phát triển không?
Commit gần nhất trên reactnativecn/react-native-website là 9 ngày trước (theo timestamp GitHub). Repo có 319 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
reactnativecn/react-native-website dùng license gì?
reactnativecn/react-native-website phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
reactnativecn/react-native-website là gì?
reactnativecn/react-native-website (reactnativecn/react-native-website) là dự án MDX trên GitHub. Theo mô tả gốc: React Native 中文网
reactnativecn/react-native-website viết bằng ngôn ngữ gì?
reactnativecn/react-native-website chủ yếu viết bằng MDX. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về react-native-website?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về react-native-website.