Last active
March 13, 2019 13:26
-
-
Save appwebtech/0ee7707af647bcd79e1c9170b0c3eb8e to your computer and use it in GitHub Desktop.
// source https://jsbin.com
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
<script src="https://fb.me/react-with-addons-15.1.0.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.js"></script> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// Props are ideal as they pass data from Parent to Child components and they are accessed by injection | |
const Welcome = ((props) => | |
React.createElement("div", null, | |
React.createElement("h4", null, "Welcome to my homepage."), | |
React.createElement("p", null, "My names are Mr. ", props.firstName, " ", props.lastName, ".") | |
) | |
) | |
const App = (() => { | |
return ( | |
React.createElement("div", null, | |
React.createElement(Welcome, {firstName: "Joe", lastName: "Doe"}), | |
React.createElement(Welcome, {firstName: "Jane", lastName: "Doe"}) | |
) | |
) | |
}); | |
ReactDOM.render( | |
React.createElement(App, null), | |
document.getElementById('app') | |
); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// Props are ideal as they pass data from Parent to Child components and they are accessed by injection | |
const Welcome = ((props) => | |
<div> | |
<h4>Welcome to my homepage.</h4> | |
<p>My names are Mr. {props.firstName} {props.lastName}.</p> | |
</div> | |
) | |
const App = (() => { | |
return ( | |
<div> | |
<Welcome firstName="Joe" lastName="Doe"/> | |
<Welcome firstName="Jane" lastName="Doe"/> | |
</div> | |
) | |
}); | |
ReactDOM.render( | |
<App/>, | |
document.getElementById('app') | |
);</script></body> | |
</html> |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// Props are ideal as they pass data from Parent to Child components and they are accessed by injection | |
const Welcome = ((props) => | |
React.createElement("div", null, | |
React.createElement("h4", null, "Welcome to my homepage."), | |
React.createElement("p", null, "My names are Mr. ", props.firstName, " ", props.lastName, ".") | |
) | |
) | |
const App = (() => { | |
return ( | |
React.createElement("div", null, | |
React.createElement(Welcome, {firstName: "Joe", lastName: "Doe"}), | |
React.createElement(Welcome, {firstName: "Jane", lastName: "Doe"}) | |
) | |
) | |
}); | |
ReactDOM.render( | |
React.createElement(App, null), | |
document.getElementById('app') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment