Created
February 7, 2015 06:40
-
-
Save calvinf/599632a074b04ca8ab21 to your computer and use it in GitHub Desktop.
Bible Verse Example App (React.js)
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Bible Verse Example (React.js)</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css" /> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap-theme.min.css" /> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="page-header"> | |
<h1>Well Versed</h1> | |
</div> | |
<div id="verse-app"></div> | |
</div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.12.2/react.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.12.2/JSXTransformer.js"></script> | |
<script type="text/jsx"> | |
var VerseApp = React.createClass({ | |
getVerse: function() { | |
return { | |
text: "Jesus wept.", | |
ref: "John 11:35", | |
topic: "Jesus crying" | |
}; | |
}, | |
render: function() { | |
var verse = this.getVerse(); | |
return <div className="verse-container"> | |
<h2>{verse.ref}</h2> | |
<h3>{verse.topic}</h3> | |
<p>{verse.text}</p> | |
</div>; | |
} | |
}); | |
React.render( | |
<VerseApp />, | |
document.getElementById('verse-app') | |
); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment