2017-07-12 22:41:55 +08:00
|
|
|
// Run this example by adding <%= javascript_pack_tag 'hello_react' %> to the head of your layout file,
|
|
|
|
// like app/views/layouts/application.html.erb. All it does is render <div>Hello React</div> at the bottom
|
|
|
|
// of the page.
|
|
|
|
|
|
|
|
import React from 'react'
|
|
|
|
import ReactDOM from 'react-dom'
|
2017-07-27 20:21:27 +08:00
|
|
|
// import PropTypes from 'prop-types'
|
2017-07-12 22:41:55 +08:00
|
|
|
|
2017-07-27 20:21:27 +08:00
|
|
|
const Settings = () => (
|
|
|
|
<div>Settings page</div>
|
2017-07-12 22:41:55 +08:00
|
|
|
)
|
|
|
|
|
2017-07-27 20:21:27 +08:00
|
|
|
// Settings.defaultProps = {
|
|
|
|
// name: 'David'
|
|
|
|
// }
|
2017-07-12 22:41:55 +08:00
|
|
|
|
2017-07-27 20:21:27 +08:00
|
|
|
// Settings.propTypes = {
|
|
|
|
// name: PropTypes.string
|
|
|
|
// }
|
2017-07-12 22:41:55 +08:00
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
ReactDOM.render(
|
2017-07-27 20:21:27 +08:00
|
|
|
<Settings />,
|
2017-07-13 20:11:01 +08:00
|
|
|
document.body.appendChild(document.createElement('div'))
|
2017-07-12 22:41:55 +08:00
|
|
|
)
|
|
|
|
})
|