Skip to content

Commit 0f835f9

Browse files
merging all conflicts
2 parents 6810068 + 2534424 commit 0f835f9

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/components/Layout/HomeContent.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,11 @@ export function HomeContent() {
264264
color="gray"
265265
icon="framework"
266266
href="/learn/creating-a-react-app">
267+
<<<<<<< HEAD
267268
開始使用框架
269+
=======
270+
Get started with a framework
271+
>>>>>>> 2534424ec6c433cc2c811d5a0bd5a65b75efa5f0
268272
</CTA>
269273
</div>
270274
</Center>

src/content/learn/add-react-to-an-existing-project.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ title: 將 React 加入到一個現有的專案
2020

2121
以下是我們推薦的設定方式:
2222

23+
<<<<<<< HEAD
2324
1. 使用其中一個[基於 React 的框架](/learn/creating-a-react-app)**建構你的應用程式中的 React 部分**
2425
2. **在你的框架設定中指定 `/some-app` 作為*基本路徑***。(這裡是如何設定:[Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath)[Gatsby](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/))。
2526
3. **設定你的伺服器或代理**,讓所有在 `/some-app/` 下的請求都由 React 應用程式處理。
27+
=======
28+
1. **Build the React part of your app** using one of the [React-based frameworks](/learn/creating-a-react-app).
29+
2. **Specify `/some-app` as the *base path*** in your framework's configuration (here's how: [Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath), [Gatsby](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/)).
30+
3. **Configure your server or a proxy** so that all requests under `/some-app/` are handled by your React app.
31+
>>>>>>> 2534424ec6c433cc2c811d5a0bd5a65b75efa5f0
2632
2733
這可確保你的應用程式的 React 部分可以[受益於融入這些框架的最佳實踐](/learn/build-a-react-app-from-scratch#consider-using-a-framework)
2834

@@ -149,7 +155,11 @@ root.render(<NavigationBar />);
149155

150156
注意原始的 HTML 內容從 `index.html` 被保留下來,但是你自己的 `NavigationBar` React component 現在出現在你 HTML 中的 `<nav id="navigation">` 內。閱讀 [`createRoot` 使用文件](/reference/react-dom/client/createRoot#rendering-a-page-partially-built-with-react)以了解更多關於在現有 HTML 頁面中 render React component 的資訊。
151157

158+
<<<<<<< HEAD
152159
當你在現有的專案中採用 React 時,通常會從小的互動式 component(如按鈕)開始,然後逐漸「向上移動」,直到最終整個頁面都是使用 React 建構的。如果你達到了那裡,我們建議立即遷移到[一個 React 框架](/learn/creating-a-react-app) ,以充分利用 React 的優勢。
160+
=======
161+
When you adopt React in an existing project, it's common to start with small interactive components (like buttons), and then gradually keep "moving upwards" until eventually your entire page is built with React. If you ever reach that point, we recommend migrating to [a React framework](/learn/creating-a-react-app) right after to get the most out of React.
162+
>>>>>>> 2534424ec6c433cc2c811d5a0bd5a65b75efa5f0
153163
154164
## 在現有的原生手機應用程式中使用 React Native {/*using-react-native-in-an-existing-native-mobile-app*/}
155165

src/content/learn/your-first-component.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ function Profile() {
215215

216216
你的 React 應用程式從「root」component 開始。通常,在你啟動一個新專案時,它會自動被建立。例如,如果你使用 [CodeSandbox](https://codesandbox.io/)[Next.js](https://nextjs.org/) 框架,root component 會定義在 pages/index.js 中。在這些例子中,你一直在 export root component。
217217

218+
<<<<<<< HEAD
218219
[基於 React 的框架](/learn/creating-a-react-app)更進一步。它們不使用空的 HTML 檔案,然後讓 React 用 JavaScript「接管」頁面管理,而是**會從你的 React 元件自動生成 HTML。這讓你的應用程式能夠在 JavaScript 程式碼載入之前就顯示一些內容。
220+
=======
221+
[React-based frameworks](/learn/creating-a-react-app) take this a step further. Instead of using an empty HTML file and letting React "take over" managing the page with JavaScript, they *also* generate the HTML automatically from your React components. This allows your app to show some content before the JavaScript code loads.
222+
>>>>>>> 2534424ec6c433cc2c811d5a0bd5a65b75efa5f0
219223
220224
[基於 React 的框架]((/learn/start-a-new-react-project)) 更進一步。它們不只是使用空的 HTML 檔案並讓 React 通過 JavaScript 管理頁面,它們*還會*自動從你的 React component 中生成 HTML。這使得你的應用程式在 JavaScript 程式碼載入之前就能顯示一些內容。
221225

0 commit comments

Comments
 (0)