Created
November 12, 2018 02:55
-
-
Save camilomontoyau/a07af05f7965c1024a0c58c33f53a99a to your computer and use it in GitHub Desktop.
react es 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
<html> | |
<head> | |
<title>un título</title> | |
<meta charset="UTF-8" /> | |
<style> | |
.letra-color-azul { | |
color: blue; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="app"></div> | |
<script | |
type="text/javascript" | |
src="https://unpkg.com/react@16.6.1/umd/react.development.js" | |
></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script> | |
<script type="text/babel"> | |
const app = document.getElementById('app'); | |
const Contenedor = ({ nombre }) => <div>hola {nombre}</div>; // function component recibiendo propiedades destructuradas | |
const nombre = 'damas y caballeros'; // variable para pasar al nombre | |
ReactDOM.render(<Contenedor nombre={nombre} />, app); // pasar la propiedad parecido a elementos html nativos | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment