Created
June 24, 2016 23:50
-
-
Save marti1125/0ee985aeddc9841f9bbd56b46dfb8f15 to your computer and use it in GitHub Desktop.
react web
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Recent Changes (React JS Project)</title> | |
<script src="https://fb.me/react-15.1.0.min.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js"></script> | |
</head> | |
<body> | |
<script type="text/babel"> | |
var App = React.createClass({ | |
render: function(){ | |
var data = [{ "when": "2 minutes ago", | |
"who": "Jill Dupre", | |
"description": "Created new account" | |
}, | |
{ | |
"when": "1 hour ago", | |
"who": "Lose White", | |
"description": "Added fist chapter" | |
}, | |
{ | |
"when": "2 hours ago", | |
"who": "Jordan Whash", | |
"description": "Created new account" | |
}]; | |
var rows = data.map(function(row){ | |
return <tr> | |
<td>{row.when}</td> | |
<td>{row.who}</td> | |
<td>{row.description}</td> | |
</tr> | |
}); | |
return <div> | |
<h1>Recent Changes</h1> | |
<table> | |
<thead> | |
<th>When</th> | |
<th>Who</th> | |
<th>Description</th> | |
</thead> | |
{rows} | |
</table> | |
</div> | |
} | |
}); | |
ReactDOM.render(<App/>, document.body); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment