# Hello World
開始學習 React 最簡單的方式是使用 CodePen 中這個 [Hello World 例子代碼](http://codepen.io/gaearon/pen/ZpvBNJ?editors=0010)。你不需要安裝任何東西;只要在另一個標簽頁中打開它并跟隨閱讀我們的例子。如果使用一個本地開發環境,查閱 安裝 部分。
最簡單的 React 例子:
~~~
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('root')
)
~~~
它渲染一個包含 “Hello World” 的頭部到頁面中。
下面的章節將會逐步引導你使用 React 。我們將會檢查 React app 構建的部分:元素和組件。一旦你掌握了它們,你可以創建通過小的可復用的部分構建復雜的 apps 。
## 關于 JavaScript 的注意
React 是一個 JavaScript 庫,所以它假定你對 JavaScript 有一些基礎的了解。如果你不是很明確,我們建議你[重新學習 JavaScript 知識](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript),才能容易的繼續學習。
我們也使用了一些 ES6 語法。我們試圖盡量少的使用它,因為這是相對新的內容,但是我們鼓勵你熟悉比如[箭頭函數](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions)、[類](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes)、[模板字面值](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)、[let](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let) 和 [const](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const) 語句。你可以使用[ Babel REPL](http://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=es2015%2Creact&experimental=false&loose=false&spec=false&code=const%20element%20%3D%20%3Ch1%3EHello%2C%20world!%3C%2Fh1%3E%3B%0Aconst%20container%20%3D%20document.getElementById\('root'\)%3B%0AReactDOM.render\(element%2C%20container\)%3B%0A) 來檢查 ES6 代碼會編譯成什么。