Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update package.json to CRA2 and cleanup React Component imports #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 01-imperative-to-declarative/exercise/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion 01-imperative-to-declarative/lecture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions 01-imperative-to-declarative/lecture/src/App.final.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -29,7 +29,7 @@ class Tone extends React.Component {
}
}

class App extends React.Component {
class App extends Component {
state = {
isPlaying: false,
pitch: 0,
Expand Down
4 changes: 2 additions & 2 deletions 01-imperative-to-declarative/lecture/src/App.start.js
Original file line number Diff line number Diff line change
@@ -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 = () => {
Expand Down
4 changes: 2 additions & 2 deletions 01-imperative-to-declarative/lecture/src/lib/SineWave.js
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
2 changes: 1 addition & 1 deletion 02-hocs-render-props/exercise/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion 02-hocs-render-props/lecture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions 02-hocs-render-props/lecture/src/App.final.hoc.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -34,7 +34,7 @@ let withGeo = Comp =>
}
};

class App extends React.Component {
class App extends Component {
render() {
return (
<div className="app">
Expand Down
8 changes: 4 additions & 4 deletions 02-hocs-render-props/lecture/src/App.final.render-props.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -34,7 +34,7 @@ class GeoPosition extends React.Component {
}
}

class Address extends React.Component {
class Address extends Component {
state = {
address: null
};
Expand All @@ -51,7 +51,7 @@ class Address extends React.Component {
}
}

class App extends React.Component {
class App extends Component {
render() {
return (
<GeoPosition>
Expand Down
4 changes: 2 additions & 2 deletions 02-hocs-render-props/lecture/src/App.start.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 5 additions & 3 deletions 02-hocs-render-props/lecture/src/lib/LoadingDots.js
Original file line number Diff line number Diff line change
@@ -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(() => {
Expand Down
4 changes: 2 additions & 2 deletions 02-hocs-render-props/lecture/src/lib/Map.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { Component } from "react";

import {
withGoogleMap,
Expand Down Expand Up @@ -29,7 +29,7 @@ const InnerMap = withGoogleMap(({ lat, lng, info }) => (
</GoogleMap>
));

class Map extends React.Component {
class Map extends Component {
componentWillMount() {
if (!window.google) {
loadMaps(() => {
Expand Down
2 changes: 1 addition & 1 deletion 03-clone-element/exercise/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"react-icons": "2"
},
"devDependencies": {
"react-scripts": "1.0.10"
"react-scripts": "2.0.4"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion 03-clone-element/lecture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions 03-clone-element/lecture/src/App.context.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Tabs extends Component {
}
}

let TabList = props => {
let TabList = (props) => {
return (
<TabsContext.Consumer>
{context => {
Expand All @@ -49,7 +49,7 @@ let TabList = props => {
);
};

let Tab = props => {
let Tab = (props) => {
const isDisabled = props.isDisabled;
const isActive = props.isActive;
return (
Expand All @@ -68,7 +68,7 @@ let Tab = props => {
);
};

let TabPanels = props => {
let TabPanels = (props) => {
return (
<TabsContext.Consumer>
{context => (
Expand All @@ -80,7 +80,7 @@ let TabPanels = props => {
);
};

let TabPanel = props => props.children;
let TabPanel = (props) => props.children;

class App extends Component {
render() {
Expand Down
4 changes: 2 additions & 2 deletions 04-context/exercise/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "03",
"name": "04",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand All @@ -8,7 +8,7 @@
"react-icons": "2"
},
"devDependencies": {
"react-scripts": "1.0.10"
"react-scripts": "2.0.4"
},
"scripts": {
"start": "react-scripts start",
Expand Down
16 changes: 8 additions & 8 deletions 04-context/exercise/src/App.solution.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Other notes about the `<audio/>` tag:
Good luck!
*/

import React from "react";
import React, { Component } from "react";
import podcast from "./lib/podcast.mp4";
import mario from "./lib/mariobros.mp3";
import FaPause from "react-icons/lib/fa/pause";
Expand All @@ -53,7 +53,7 @@ import FaRotateLeft from "react-icons/lib/fa/rotate-left";

let AudioContext = React.createContext();

class AudioPlayer extends React.Component {
class AudioPlayer extends Component {
state = {
isPlaying: false,
duration: null,
Expand Down Expand Up @@ -107,7 +107,7 @@ class AudioPlayer extends React.Component {
}
}

class Play extends React.Component {
class Play extends Component {
render() {
return (
<AudioContext.Consumer>
Expand All @@ -126,7 +126,7 @@ class Play extends React.Component {
}
}

class Pause extends React.Component {
class Pause extends Component {
render() {
return (
<AudioContext.Consumer>
Expand All @@ -145,7 +145,7 @@ class Pause extends React.Component {
}
}

class PlayPause extends React.Component {
class PlayPause extends Component {
render() {
return (
<AudioContext.Consumer>
Expand All @@ -155,7 +155,7 @@ class PlayPause extends React.Component {
}
}

class JumpForward extends React.Component {
class JumpForward extends Component {
render() {
return (
<AudioContext.Consumer>
Expand All @@ -174,7 +174,7 @@ class JumpForward extends React.Component {
}
}

class JumpBack extends React.Component {
class JumpBack extends Component {
render() {
return (
<AudioContext.Consumer>
Expand All @@ -193,7 +193,7 @@ class JumpBack extends React.Component {
}
}

class Progress extends React.Component {
class Progress extends Component {
render() {
return (
<AudioContext.Consumer>
Expand Down
16 changes: 8 additions & 8 deletions 04-context/exercise/src/App.start.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ Other notes about the `<audio/>` tag:
Good luck!
*/

import React from "react";
import React, { Component } from "react";
import podcast from "./lib/podcast.mp4";
import mario from "./lib/mariobros.mp3";
import FaPause from "react-icons/lib/fa/pause";
import FaPlay from "react-icons/lib/fa/play";
import FaRepeat from "react-icons/lib/fa/repeat";
import FaRotateLeft from "react-icons/lib/fa/rotate-left";

class AudioPlayer extends React.Component {
class AudioPlayer extends Component {
render() {
return (
<div className="audio-player">
Expand All @@ -68,7 +68,7 @@ class AudioPlayer extends React.Component {
}
}

class Play extends React.Component {
class Play extends Component {
render() {
return (
<button
Expand All @@ -83,7 +83,7 @@ class Play extends React.Component {
}
}

class Pause extends React.Component {
class Pause extends Component {
render() {
return (
<button
Expand All @@ -98,13 +98,13 @@ class Pause extends React.Component {
}
}

class PlayPause extends React.Component {
class PlayPause extends Component {
render() {
return null;
}
}

class JumpForward extends React.Component {
class JumpForward extends Component {
render() {
return (
<button
Expand All @@ -119,7 +119,7 @@ class JumpForward extends React.Component {
}
}

class JumpBack extends React.Component {
class JumpBack extends Component {
render() {
return (
<button
Expand All @@ -134,7 +134,7 @@ class JumpBack extends React.Component {
}
}

class Progress extends React.Component {
class Progress extends Component {
render() {
return (
<div className="progress" onClick={null}>
Expand Down
Loading