Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
This file contains 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
// src/components/Description.js | |
// Import react | |
import React from 'react'; | |
// Create a function component and set props as the argument | |
function Description (props) { | |
return ( | |
<div> |
This file contains 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
// src/App.js | |
import React, { Component } from 'react'; | |
import User from './components/User'; | |
// App.js | |
class App extends Component { | |
state = { | |
userA: { | |
firstName: "Harper", | |
avatarUrl: "https://www.refreshmiami.com/wp-content/uploads/2018/07/55085_logo-ironhack.png" |
This file contains 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
// src/App.js | |
import React, { Component } from 'react'; | |
import User from './components/User'; | |
import Navbar from './components/Navbar'; | |
class App extends Component { | |
state = { | |
userA: { | |
firstName: "Harper", |
This file contains 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 './App.css'; | |
import Clock from './components/Clock'; | |
class App extends React.Component { | |
state = { | |
currentTime: 'N/A', | |
showClock: true | |
} |
This file contains 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
... | |
class Clock extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
year: props.year, | |
}; | |
console.log('IN CONSTRUCTOR'); | |
} |
This file contains 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
// ... | |
class Clock extends React.Component { | |
constructor(props) { | |
// ... | |
console.log('IN CONSTRUCTOR'); | |
}; | |
// custom methods and lifecycle methods go after the `constructor` |
This file contains 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
// ... | |
class App extends React.Component { | |
// ... | |
// ... |
This file contains 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'; | |
class Clock extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
year: 2020, | |
timerId: null, // <-- CREATE NEW PROPERTY | |
timer: 0, // <-- CREATE NEW PROPERTY |
This file contains 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
// App.js | |
import React, { Component } from 'react'; | |
import './App.css'; | |
import Counter from './components/Counter' | |
class App extends Component { |
OlderNewer