You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can definitely use React without a framework--that's how you'd [use React for a part of your page.](/learn/add-react-to-an-existing-project#using-react-for-a-part-of-your-existing-page)**However, if you're building a new app or a site fully with React, we recommend using a framework.**
Even if you don't need routing or data fetching at first, you'll likely want to add some libraries for them. As your JavaScript bundle grows with every new feature, you might have to figure out how to split code for every route individually. As your data fetching needs get more complex, you are likely to encounter server-client network waterfalls that make your app feel very slow. As your audience includes more users with poor network conditions and low-end devices, you might need to generate HTML from your components to display content early--either on the server, or during the build time. Changing your setup to run some of your code on the server or during the build can be very tricky.
24
+
即使一開始你不需要 routing 或 data fetching,你可能很快就會想為它們加入一些 library。隨著每新增一個功能,JavaScript 的 bundle 會逐漸增大,你可能需要想辦法為每個 route 單獨分割程式碼。隨著 data fetching 需求變得更複雜,你可能會遇到伺服器與客戶端的網路 waterfall 效應,這會讓你的應用程式感覺非常慢。當你的使用者群體包括更多網路條件差或低端設備的使用者時,你可能需要從 component 產生 HTML,以便提早顯示內容——無論是在伺服器上,還是在建構時。將你的設定更改為在伺服器或建置過程中執行部分程式碼可能會非常棘手。
25
25
26
-
**These problems are not React-specific. This is why Svelte has SvelteKit, Vue has Nuxt, and so on.** To solve these problems on your own, you'll need to integrate your bundler with your router and with your data fetching library. It's not hard to get an initial setup working, but there are a lot of subtleties involved in making an app that loads quickly even as it grows over time. You'll want to send down the minimal amount of app code but do so in a single client–server roundtrip, in parallel with any data required for the page. You'll likely want the page to be interactive before your JavaScript code even runs, to support progressive enhancement. You may want to generate a folder of fully static HTML files for your marketing pages that can be hosted anywhere and still work with JavaScript disabled. Building these capabilities yourself takes real work.
**React frameworks on this page solve problems like these by default, with no extra work from your side.**They let you start very lean and then scale your app with your needs. Each React framework has a community, so finding answers to questions and upgrading tooling is easier. Frameworks also give structure to your code, helping you and others retain context and skills between different projects. Conversely, with a custom setup it's easier to get stuck on unsupported dependency versions, and you'll essentially end up creating your own framework—albeit one with no community or upgrade path (and if it's anything like the ones we've made in the past, more haphazardly designed).
If your app has unusual constraints not served well by these frameworks, or you prefer to solve these problems yourself, you can roll your own custom setup with React. Grab `react`and`react-dom` from npm, set up your custom build process with a bundler like [Vite](https://vitejs.dev/)or[Parcel](https://parceljs.org/), and add other tools as you need them for routing, static generation or server-side rendering, and more.
These frameworks support all the features you need to deploy and scale your app in production and are working towards supporting our [full-stack architecture vision](#which-features-make-up-the-react-teams-full-stack-architecture-vision). All of the frameworks we recommend are open source with active communities for support, and can be deployed to your own server or a hosting provider. If you’re a framework author interested in being included on this list, [please let us know](https://github.com/reactjs/react.dev/issues/new?assignees=&labels=type%3A+framework&projects=&template=3-framework.yml&title=%5BFramework%5D%3A+).
36
+
這些框架支援你在 production 環境中部署和擴充應用程式所需的所有功能,並正在努力支持我們的 [full-stack 架構願景](#which-features-make-up-the-react-teams-full-stack-architecture-vision)。我們推薦的所有框架都是開源的,擁有活躍的社區提供支援,並且可以部署到你自己的伺服器或託管提供商。如果你是框架作者,有興趣被列入這個清單,[請讓我們知道](https://github.com/reactjs/react.dev/issues/new?assignees=&labels=type%3A+framework&projects=&template=3-framework.yml&title=%5BFramework%5D%3A+)。
0 commit comments