Skip to content

Instantly share code, notes, and snippets.

@camilomontoyau
Created November 12, 2018 02:55
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 camilomontoyau/a07af05f7965c1024a0c58c33f53a99a to your computer and use it in GitHub Desktop.
Save camilomontoyau/a07af05f7965c1024a0c58c33f53a99a to your computer and use it in GitHub Desktop.
react es js
<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