-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Installed Material UI and amended example MUI and react component
- Loading branch information
1 parent
55244d3
commit 8bd7263
Showing
6 changed files
with
11,053 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import FaceIcon from "@material-ui/icons/Face"; | ||
|
||
class HelloWorld extends React.Component { | ||
render () { | ||
render() { | ||
return ( | ||
<React.Fragment> | ||
Greeting: {this.props.greeting} | ||
<FaceIcon /> | ||
</React.Fragment> | ||
); | ||
} | ||
} | ||
|
||
HelloWorld.propTypes = { | ||
greeting: PropTypes.string | ||
greeting: PropTypes.string, | ||
}; | ||
export default HelloWorld | ||
export default HelloWorld; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
// 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"; | ||
|
||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import PropTypes from 'prop-types' | ||
|
||
const Hello = props => ( | ||
<div>Hello {props.name}!</div> | ||
) | ||
const Hello = (props) => <div>Hello {props.name}!</div>; | ||
|
||
Hello.defaultProps = { | ||
name: 'David' | ||
} | ||
name: "David", | ||
}; | ||
|
||
Hello.propTypes = { | ||
name: PropTypes.string | ||
} | ||
name: PropTypes.string, | ||
}; | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
document.addEventListener("DOMContentLoaded", () => { | ||
ReactDOM.render( | ||
<Hello name="React" />, | ||
document.body.appendChild(document.createElement('div')), | ||
) | ||
}) | ||
document.body.appendChild(document.createElement("div")) | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.