diff --git a/01-imperative-to-declarative/exercise/package.json b/01-imperative-to-declarative/exercise/package.json index 7ccba49..ca5a452 100644 --- a/01-imperative-to-declarative/exercise/package.json +++ b/01-imperative-to-declarative/exercise/package.json @@ -7,7 +7,7 @@ "react-dom": "^16.5.0" }, "devDependencies": { - "react-scripts": "1.0.10" + "react-scripts": "2.0.4" }, "scripts": { "start": "react-scripts start", diff --git a/01-imperative-to-declarative/lecture/package.json b/01-imperative-to-declarative/lecture/package.json index 186b911..b2a1d3f 100644 --- a/01-imperative-to-declarative/lecture/package.json +++ b/01-imperative-to-declarative/lecture/package.json @@ -7,7 +7,7 @@ "react-dom": "^16.5.0" }, "devDependencies": { - "react-scripts": "1.0.10" + "react-scripts": "2.0.4" }, "scripts": { "start": "react-scripts start", diff --git a/01-imperative-to-declarative/lecture/src/App.final.js b/01-imperative-to-declarative/lecture/src/App.final.js index 047738f..fc81ac8 100644 --- a/01-imperative-to-declarative/lecture/src/App.final.js +++ b/01-imperative-to-declarative/lecture/src/App.final.js @@ -1,8 +1,8 @@ -import React from "react"; +import React, { Component } from "react"; import createOscillator from "./lib/createOscillator"; import SineWave from "./lib/SineWave"; -class Tone extends React.Component { +class Tone extends Component { oscillator = createOscillator(); componentDidMount() { @@ -29,7 +29,7 @@ class Tone extends React.Component { } } -class App extends React.Component { +class App extends Component { state = { isPlaying: false, pitch: 0, diff --git a/01-imperative-to-declarative/lecture/src/App.start.js b/01-imperative-to-declarative/lecture/src/App.start.js index 9e1bcbb..5e70b6c 100644 --- a/01-imperative-to-declarative/lecture/src/App.start.js +++ b/01-imperative-to-declarative/lecture/src/App.start.js @@ -1,7 +1,7 @@ -import React from "react"; +import React, { Component } from "react"; import createOscillator from "./lib/createOscillator"; -class App extends React.Component { +class App extends Component { oscillator = createOscillator(); play = () => { diff --git a/01-imperative-to-declarative/lecture/src/lib/SineWave.js b/01-imperative-to-declarative/lecture/src/lib/SineWave.js index 4ae5073..355a204 100644 --- a/01-imperative-to-declarative/lecture/src/lib/SineWave.js +++ b/01-imperative-to-declarative/lecture/src/lib/SineWave.js @@ -1,8 +1,8 @@ // modified from http://codepen.io/enxaneta/pen/jbVLGb/, see copyright there -import React from "react"; +import React, { Component } from "react"; -class SineWave extends React.Component { +class SineWave extends Component { componentDidMount() { this.ctx = this.node.getContext("2d"); const { width, height } = this.node.getBoundingClientRect(); diff --git a/02-hocs-render-props/exercise/package.json b/02-hocs-render-props/exercise/package.json index 6de512c..27de650 100644 --- a/02-hocs-render-props/exercise/package.json +++ b/02-hocs-render-props/exercise/package.json @@ -8,7 +8,7 @@ "react-transition-group": "^2.4.0" }, "devDependencies": { - "react-scripts": "1.0.10" + "react-scripts": "2.0.4" }, "scripts": { "start": "react-scripts start", diff --git a/02-hocs-render-props/lecture/package.json b/02-hocs-render-props/lecture/package.json index 8e7055e..2c0e239 100644 --- a/02-hocs-render-props/lecture/package.json +++ b/02-hocs-render-props/lecture/package.json @@ -8,7 +8,7 @@ "react-google-maps": "^9.4.5" }, "devDependencies": { - "react-scripts": "1.0.10" + "react-scripts": "2.0.4" }, "scripts": { "start": "react-scripts start", diff --git a/02-hocs-render-props/lecture/src/App.final.hoc.js b/02-hocs-render-props/lecture/src/App.final.hoc.js index f42a90a..d0fc2ac 100644 --- a/02-hocs-render-props/lecture/src/App.final.hoc.js +++ b/02-hocs-render-props/lecture/src/App.final.hoc.js @@ -1,9 +1,9 @@ -import React from "react"; +import React, { Component } from "react"; import LoadingDots from "./lib/LoadingDots"; import Map from "./lib/Map"; let withGeo = Comp => - class GeoPosition extends React.Component { + class GeoPosition extends Component { state = { coords: null, error: null @@ -34,7 +34,7 @@ let withGeo = Comp => } }; -class App extends React.Component { +class App extends Component { render() { return (
diff --git a/02-hocs-render-props/lecture/src/App.final.render-props.js b/02-hocs-render-props/lecture/src/App.final.render-props.js index cbbe372..2745560 100644 --- a/02-hocs-render-props/lecture/src/App.final.render-props.js +++ b/02-hocs-render-props/lecture/src/App.final.render-props.js @@ -1,9 +1,9 @@ -import React from "react"; +import React, { Component } from "react"; import LoadingDots from "./lib/LoadingDots"; import Map from "./lib/Map"; import getAddressFromCoords from "./lib/getAddressFromCoords"; -class GeoPosition extends React.Component { +class GeoPosition extends Component { state = { coords: null, error: null @@ -34,7 +34,7 @@ class GeoPosition extends React.Component { } } -class Address extends React.Component { +class Address extends Component { state = { address: null }; @@ -51,7 +51,7 @@ class Address extends React.Component { } } -class App extends React.Component { +class App extends Component { render() { return ( diff --git a/02-hocs-render-props/lecture/src/App.start.js b/02-hocs-render-props/lecture/src/App.start.js index 5a5cb54..994fe79 100644 --- a/02-hocs-render-props/lecture/src/App.start.js +++ b/02-hocs-render-props/lecture/src/App.start.js @@ -1,9 +1,9 @@ -import React from "react"; +import React, { Component } from "react"; import LoadingDots from "./lib/LoadingDots"; import Map from "./lib/Map"; import getAddressFromCoords from "./lib/getAddressFromCoords"; -class App extends React.Component { +class App extends Component { state = { coords: null, error: null diff --git a/02-hocs-render-props/lecture/src/lib/LoadingDots.js b/02-hocs-render-props/lecture/src/lib/LoadingDots.js index 86472e1..ac59e55 100644 --- a/02-hocs-render-props/lecture/src/lib/LoadingDots.js +++ b/02-hocs-render-props/lecture/src/lib/LoadingDots.js @@ -1,12 +1,14 @@ -import React from "react"; +import React, { Component } from "react"; -class LoadingDots extends React.Component { +class LoadingDots extends Component { static defaultProps = { interval: 300, dots: 3 }; - state = { frame: 1 }; + state = { + frame: 1 + }; componentDidMount() { this.interval = setInterval(() => { diff --git a/02-hocs-render-props/lecture/src/lib/Map.js b/02-hocs-render-props/lecture/src/lib/Map.js index 341e2e6..758f8cb 100644 --- a/02-hocs-render-props/lecture/src/lib/Map.js +++ b/02-hocs-render-props/lecture/src/lib/Map.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, { Component } from "react"; import { withGoogleMap, @@ -29,7 +29,7 @@ const InnerMap = withGoogleMap(({ lat, lng, info }) => ( )); -class Map extends React.Component { +class Map extends Component { componentWillMount() { if (!window.google) { loadMaps(() => { diff --git a/03-clone-element/exercise/package.json b/03-clone-element/exercise/package.json index 3960d66..ea4ec7c 100644 --- a/03-clone-element/exercise/package.json +++ b/03-clone-element/exercise/package.json @@ -8,7 +8,7 @@ "react-icons": "2" }, "devDependencies": { - "react-scripts": "1.0.10" + "react-scripts": "2.0.4" }, "scripts": { "start": "react-scripts start", diff --git a/03-clone-element/lecture/package.json b/03-clone-element/lecture/package.json index 46216f6..751f6e6 100644 --- a/03-clone-element/lecture/package.json +++ b/03-clone-element/lecture/package.json @@ -8,7 +8,7 @@ "react-icons": "^2.2.5" }, "devDependencies": { - "react-scripts": "1.0.10" + "react-scripts": "2.0.4" }, "scripts": { "start": "react-scripts start", diff --git a/03-clone-element/lecture/src/App.context.js b/03-clone-element/lecture/src/App.context.js index ce26490..e1f2f9c 100644 --- a/03-clone-element/lecture/src/App.context.js +++ b/03-clone-element/lecture/src/App.context.js @@ -29,7 +29,7 @@ class Tabs extends Component { } } -let TabList = props => { +let TabList = (props) => { return ( {context => { @@ -49,7 +49,7 @@ let TabList = props => { ); }; -let Tab = props => { +let Tab = (props) => { const isDisabled = props.isDisabled; const isActive = props.isActive; return ( @@ -68,7 +68,7 @@ let Tab = props => { ); }; -let TabPanels = props => { +let TabPanels = (props) => { return ( {context => ( @@ -80,7 +80,7 @@ let TabPanels = props => { ); }; -let TabPanel = props => props.children; +let TabPanel = (props) => props.children; class App extends Component { render() { diff --git a/04-context/exercise/package.json b/04-context/exercise/package.json index 3960d66..dd4d5a4 100644 --- a/04-context/exercise/package.json +++ b/04-context/exercise/package.json @@ -1,5 +1,5 @@ { - "name": "03", + "name": "04", "version": "0.1.0", "private": true, "dependencies": { @@ -8,7 +8,7 @@ "react-icons": "2" }, "devDependencies": { - "react-scripts": "1.0.10" + "react-scripts": "2.0.4" }, "scripts": { "start": "react-scripts start", diff --git a/04-context/exercise/src/App.solution.js b/04-context/exercise/src/App.solution.js index 3430836..7073785 100644 --- a/04-context/exercise/src/App.solution.js +++ b/04-context/exercise/src/App.solution.js @@ -43,7 +43,7 @@ Other notes about the `