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 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>Hola Mundo Reactjs</title> | |
</head> | |
<body> | |
<div id="app"> |
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
const path = require('path') | |
module.exports = { | |
mode: 'production', | |
entry: { | |
"home": path.resolve(__dirname, 'src/entries/home.js'), | |
}, | |
output: { | |
path: path.resolve(__dirname, "dist"), | |
filename: 'js/[name].js', |
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
import React, { Component } from 'react' | |
import ReactDOM from 'react-dom' | |
import '../styles/home.css' | |
const app = document.getElementById('app') | |
class Home extends Component { | |
render() { | |
return ( |
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
.Home { | |
align-content: center; | |
background: #206e8d; | |
display: flex; | |
justify-content: center; | |
margin: auto auto; | |
height: 100px; | |
width: 80%; | |
} |
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
const path = require('path') | |
module.exports = { | |
mode: 'production', | |
entry: { | |
"home": path.resolve(__dirname, 'src/entries/home.js'), | |
}, | |
output: { | |
path: path.resolve(__dirname, "dist"), | |
filename: 'js/[name].js', |
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 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>Hola Mundo Reactjs</title> | |
<link rel="stylesheet" href="dist/css/home.css"> | |
</head> | |
<body> |
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
// Clasic Function | |
function MyComponent(props) { | |
return( | |
<div> | |
<h1>Titlte</h1> | |
<p>Mi first component</p> | |
</div> | |
) | |
} |
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
import React from 'react' | |
import '../styles/home.css' | |
const Home = props => { | |
const { data } = props | |
return ( | |
<div className="Home"> | |
<h1>People List</h1> | |
<div className="People-list"> | |
{ |
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
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import Home from '../containers/Home' | |
const app = document.getElementById('app') | |
ReactDOM.render(<Home />, app) |
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
.Home { | |
background: #206e8d; | |
margin: auto auto; | |
width: 80%; | |
} | |
.Home h1 { | |
text-align: center; | |
padding-top: 5px; | |
} |