Skip to content

Commit 1604428

Browse files
committed
update to React 17
1 parent 382f1c4 commit 1604428

12 files changed

Lines changed: 12825 additions & 8135 deletions

.eslintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
}
99
],
1010
"strict": "off",
11+
"react/jsx-uses-react": "off",
12+
"react/react-in-jsx-scope": "off",
1113
"react/prop-types": "off",
1214
"react/no-danger": "off"
1315
},

.prettierrc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"endOfLine": "lf",
3-
"semi": false,
4-
"singleQuote": false,
5-
"tabWidth": 2,
6-
"trailingComma": "es5"
2+
"semi": false
73
}

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ This is a simple React example showing how to consume a restful API.
44

55
Run `npm run start` to start the JSON server and the React client.
66

7-
## Versions
8-
9-
- [Version 3](https://github.com/DavidBuck/react-rest-example/tree/v3.0) - Example using hooks and async/await. React version 16.13.1
10-
- [Version 2](https://github.com/DavidBuck/react-rest-example/tree/v2.0) - Example using a class component and async/await. React version 16.13.1
11-
- [Version 1](https://github.com/DavidBuck/react-rest-example/tree/v1.0) - Example using a class component and promises. React version 16.13.1.
12-
137
## Tools
148

159
- [JSON Server](https://github.com/typicode/json-server)
1610
- [Tailwind](https://tailwindcss.com)
11+
12+
## Versions
13+
14+
- [Version 3.1](https://github.com/DavidBuck/react-rest-example/tree/v3.1) - Example using hooks and async/await. React version 17.0.1
15+
- [Version 3.0](https://github.com/DavidBuck/react-rest-example/tree/v3.0) - Example using hooks and async/await. React version 16.13.1
16+
- [Version 2.0](https://github.com/DavidBuck/react-rest-example/tree/v2.0) - Example using a class component and async/await. React version 16.13.1
17+
- [Version 1.0](https://github.com/DavidBuck/react-rest-example/tree/v1.0) - Example using a class component and promises. React version 16.13.1.

package-lock.json

Lines changed: 12783 additions & 7941 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
{
22
"name": "react-rest-example",
3-
"version": "1.0.0",
3+
"version": "3.1.0",
44
"description": "React REST API example",
55
"author": "David Buck",
66
"repository": "github:davidbuck/react-rest-example",
77
"license": "MIT",
88
"private": true,
99
"dependencies": {
10+
"autoprefixer": "^9.8.6",
1011
"babel-eslint": "^10.1.0",
11-
"eslint": "^6.8.0",
12-
"eslint-config-airbnb": "^18.1.0",
13-
"eslint-config-prettier": "^6.11.0",
14-
"eslint-loader": "^3.0.4",
15-
"eslint-plugin-import": "^2.20.2",
16-
"eslint-plugin-jsx-a11y": "^6.2.3",
17-
"eslint-plugin-prettier": "^3.1.3",
18-
"eslint-plugin-react": "^7.19.0",
19-
"eslint-plugin-react-hooks": "^2.5.1",
20-
"react": "^16.13.1",
21-
"react-dom": "^16.13.1",
22-
"react-scripts": "^3.4.1",
23-
"@fullhuman/postcss-purgecss": "^1.3.0",
24-
"autoprefixer": "^9.7.6",
25-
"concurrently": "^5.1.0",
26-
"json-server": "^0.16.1",
27-
"postcss-cli": "^6.1.3",
28-
"prettier": "^1.19.1",
29-
"tailwindcss": "^1.3.4"
12+
"concurrently": "^5.3.0",
13+
"eslint": "^7.12.0",
14+
"eslint-config-airbnb": "^18.2.0",
15+
"eslint-config-prettier": "^6.14.0",
16+
"eslint-loader": "^4.0.2",
17+
"eslint-plugin-import": "^2.22.1",
18+
"eslint-plugin-jsx-a11y": "^6.4.0",
19+
"eslint-plugin-prettier": "^3.1.4",
20+
"eslint-plugin-react": "^7.21.5",
21+
"eslint-plugin-react-hooks": "^4.2.0",
22+
"json-server": "^0.16.2",
23+
"postcss-cli": "^8.1.0",
24+
"prettier": "^2.1.2",
25+
"react": "^17.0.1",
26+
"react-dom": "^17.0.1",
27+
"react-scripts": "^4.0.0",
28+
"tailwindcss": "^1.9.6"
3029
},
3130
"scripts": {
3231
"server": "json-server --port 8000 --watch db.json",

postcss.config.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
const tailwindcss = require("tailwindcss")
2-
const purgecss = require("@fullhuman/postcss-purgecss")
32

43
module.exports = {
5-
plugins: [
6-
tailwindcss("./tailwind.js"),
7-
require("autoprefixer"),
8-
process.env.NODE_ENV === "production" &&
9-
purgecss({
10-
content: ["./src/**/*.js"],
11-
css: ["./src/**/*.css"],
12-
}),
13-
],
4+
plugins: [tailwindcss("./tailwind.config.js"), require("autoprefixer")],
145
}

src/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22

3-
import React, { useState } from "react"
3+
import { useState } from "react"
44

55
function App() {
66
const [posts, setPosts] = useState([])
@@ -140,7 +140,7 @@ function App() {
140140
</tr>
141141
</thead>
142142
<tbody>
143-
{posts.map(post => (
143+
{posts.map((post) => (
144144
<tr key={post.id}>
145145
<td className="border px-4 py-2 border-gray-600">{post.id}</td>
146146
<td className="border px-4 py-2 border-gray-600">{post.title}</td>

src/App.test.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import React from "react"
21
import ReactDOM from "react-dom"
32
import "./styles/tailwind.css"
43
import App from "./App"
5-
// import * as serviceWorker from './serviceWorker';
64

75
ReactDOM.render(<App />, document.getElementById("root"))
86

src/serviceWorker.js

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)