i don't fucking care any more
This commit is contained in:
parent
7c3182c8a8
commit
72926c1b74
13 changed files with 297 additions and 130 deletions
26
app/javascript/packs/menubar.jsx
Normal file
26
app/javascript/packs/menubar.jsx
Normal file
|
@ -0,0 +1,26 @@
|
|||
// 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'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
const Hello = props => (
|
||||
<div>Hello {props.name}!</div>
|
||||
)
|
||||
|
||||
Hello.defaultProps = {
|
||||
name: 'David'
|
||||
}
|
||||
|
||||
Hello.propTypes = {
|
||||
name: PropTypes.string
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
ReactDOM.render(
|
||||
<Hello name="React" />,
|
||||
document.body.appendChild(document.createElement('div')),
|
||||
)
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue