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') | |
const config = { | |
context: __dirname, | |
entry: './src/App.jsx', | |
devtool: 'cheap-eval-source-map', | |
output: { | |
path: path.join(__dirname, 'public/js'), | |
filename: 'bundle.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
{ | |
"name": "todo-app", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "node server.js", | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"format": "prettier --write --single-quote --no-semi --print-width=120 --tab-width=2 \"src/**/*.{js,jsx} \"", | |
"lint": "eslint 'src/**/*.{js,jsx}' --quiet", |
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>Document</title> | |
</head> | |
<body> | |
<div id="app"></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 {render} from 'react-dom' | |
const App = () => <div>Hello World</div> | |
render(<App />, document.getElementById('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
import React from 'react' | |
const TodoList = () => ( | |
<ul className="todoList"> | |
<li> | |
<label htmlFor="todo-1"> | |
<input type="checkbox" id="todo-1" /> | |
Learn React.js | |
</label> | |
</li> |
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 { render } from 'react-dom' | |
import styled from 'styled-components' | |
import TodoList from './components/TodoList' | |
import TodoForm from './components/TodoForm' | |
const Container = styled.div` | |
width: 250px; | |
margin: 10px auto; | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 13px |
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 styled from 'styled-components' | |
import TodoItem from './TodoItem' | |
const StyledUl = styled.ul` | |
padding: 0 | |
` | |
const TodoList = () => ( | |
<StyledUl> | |
<TodoItem id="todo-1" title="Learn React.js" /> | |
<TodoItem id="todo-2" title="Learn Vue.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 from "react" | |
import PropTypes from "prop-types" | |
import styled from 'styled-components' | |
const StyledList = styled.li` | |
list-style: none; | |
overflow: hidden; | |
width: 100%; | |
margin-bottom: 10px | |
` | |
const StyledLabel = styled.label` |
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 styled from 'styled-components' | |
const FormInput = styled.input` | |
width: 235px; | |
outline: none; | |
font-size: 13px; | |
padding-top: 7px; | |
padding-bottom: 7px; | |
padding-left: 10px; |
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 Enzyme, { shallow } from 'enzyme' | |
import Adapter from 'enzyme-adapter-react-16' | |
import TodoList from './TodoList' | |
describe('TodoList Component', () => { | |
beforeAll(() => { | |
Enzyme.configure({ adapter: new Adapter() }) | |
}) |
OlderNewer