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.
開(kāi)始學(xué)習(xí)React最好的方法是使用我們?cè)贑odePen上的Hello World事例擎淤。你不需要安裝任何東西。你只需要在新的標(biāo)簽頁(yè)中打開(kāi)它然后跟著我們給出的事例走利花。如果你希望使用本地開(kāi)發(fā)環(huán)境蹈丸,那就去看安裝說(shuō)明頁(yè)侣集。
The smallest React example looks like this:
最小的React事例長(zhǎng)成這樣:
ReactDOM.render(
? ? <h1>Hello, world!</h1>,
? ? document.getElementById('root')
);
It renders a header saying "Hello World" on the page.
它在頁(yè)面的頭部渲染了一個(gè)“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.
下面的章節(jié)我們將指導(dǎo)你去使用React。我們會(huì)查看React應(yīng)用的構(gòu)建塊:元素和組件硝桩。一旦你精通了盒齿,你就可以使用重復(fù)的小部件創(chuàng)建復(fù)雜的應(yīng)用念逞。