Skip to content

Instantly share code, notes, and snippets.

@Senhordim
Created January 6, 2018 19:26
Show Gist options
  • Save Senhordim/66bf60f2423e9c230b90ddd4c3898b96 to your computer and use it in GitHub Desktop.
Save Senhordim/66bf60f2423e9c230b90ddd4c3898b96 to your computer and use it in GitHub Desktop.
Hello word with React
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Hello Word with React!</title>
</head>
<body>
<div id="app"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/15.6.2/react-dom.js"></script>
<script>
// Criando elemento com createElement
// Espera 3 argumentos(tag, propiedade, conteúdo)
var h1 = React.createElement('h1', null, 'Hello React Word!');
// ReactDOM.render() Insere objeto "Elemento no DOM"
ReactDOM.render(h1, document.getElementById('app'));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment