Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save appwebtech/a57fd19e78f6df779df02c22f6ada447 to your computer and use it in GitHub Desktop.
Save appwebtech/a57fd19e78f6df779df02c22f6ada447 to your computer and use it in GitHub Desktop.
// source https://jsbin.com
<!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) =>
<div>
<h4>Welcome to my homepage.</h4>
<p>My names are <b>Mr. {props.firstName} {props.lastName}.</b></p>
<p>My friends name are:</p>
</div>
)
const App = (() => {
const nameArray = ["Joe", "Doe", "Jane", "Katumbi", "JoeJoe", "Nameless", "Namemore", "Lilmore", "Lilless"]
return (
<div>
<Welcome firstName="Joe" lastName="Doe"/>
<ul>
{nameArray.map(name =>
<li>{name}</li>
)}
</ul>
</div>
)
});
ReactDOM.render(
<App/>,
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 <b>Mr. {props.firstName} {props.lastName}.</b></p>
<p>My friends name are:</p>
</div>
)
const App = (() => {
const nameArray = ["Joe", "Doe", "Jane", "Katumbi", "JoeJoe", "Nameless", "Namemore", "Lilmore", "Lilless"]
return (
<div>
<Welcome firstName="Joe" lastName="Doe"/>
<ul>
{nameArray.map(name =>
<li>{name}</li>
)}
</ul>
</div>
)
});
ReactDOM.render(
<App/>,
document.getElementById('app')
);</script></body>
</html>
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 <b>Mr. {props.firstName} {props.lastName}.</b></p>
<p>My friends name are:</p>
</div>
)
const App = (() => {
const nameArray = ["Joe", "Doe", "Jane", "Katumbi", "JoeJoe", "Nameless", "Namemore", "Lilmore", "Lilless"]
return (
<div>
<Welcome firstName="Joe" lastName="Doe"/>
<ul>
{nameArray.map(name =>
<li>{name}</li>
)}
</ul>
</div>
)
});
ReactDOM.render(
<App/>,
document.getElementById('app')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment