Learning Redux
上QQ阅读APP看书,第一时间看更新

Using JSX

Now that we have JSX set up, let's use it! Edit src/index.js and replace the following line:

  React.createElement('h1', {}, 'hello world!')

With the JSX version:

  <h1>hello world!</h1>

The whole file should look like this now:

import React from 'react'
import ReactDOM from 'react-dom'

ReactDOM.render(
  <h1>hello world!</h1>,
  document.getElementById('root')
)

Restart the application and visit http://localhost:8080/; it should look the same way as before.