The easiest way to get started with React is to use this Hello World example code on CodePen. You don't need to install anything; you can just open it in another tab and follow along as we go through examples. If you'd rather use a local development environment, check out the Installation page.
開始學習React最好的方法是使用我們在CodePen上的Hello World事例。你不需要安裝任何東西。你只需要在新的標簽頁中打開它然后跟著我們給出的事例走。如果你希望使用本地開發環境,那就去看安裝說明頁。
The smallest React example looks like this:
最小的React事例長成這樣:
ReactDOM.render(
? ? <h1>Hello, world!</h1>,
? ? document.getElementById('root')
);
It renders a header saying "Hello World" on the page.
它在頁面的頭部渲染了一個“Hello World”。
The next few sections will gradually introduce you to using React. We will examine the building blocks of React apps: elements and components. Once you master them, you can create complex apps from small reusable pieces.
下面的章節我們將指導你去使用React。我們會查看React應用的構建塊:元素和組件。一旦你精通了,你就可以使用重復的小部件創建復雜的應用。