Skip to content

Instantly share code, notes, and snippets.

View jhurtadojerves's full-sized avatar
🏠
Working from home

Julio Hurtado jhurtadojerves

🏠
Working from home
  • Macas, Ecuador
  • 23:52 (UTC -05:00)
View GitHub Profile
<!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">
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',
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 (
.Home {
align-content: center;
background: #206e8d;
display: flex;
justify-content: center;
margin: auto auto;
height: 100px;
width: 80%;
}
@jhurtadojerves
jhurtadojerves / webpack.config.js
Created July 7, 2018 23:56
Create css file in assets folder
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',
<!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>
// Clasic Function
function MyComponent(props) {
return(
<div>
<h1>Titlte</h1>
<p>Mi first component</p>
</div>
)
}
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">
{
import React from 'react'
import ReactDOM from 'react-dom'
import Home from '../containers/Home'
const app = document.getElementById('app')
ReactDOM.render(<Home />, app)
.Home {
background: #206e8d;
margin: auto auto;
width: 80%;
}
.Home h1 {
text-align: center;
padding-top: 5px;
}