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
SPC f f - Find files and move around in file system | |
CTRL + vim bindings move around | |
CTRL + h = move up directory | |
/ - get to root | |
~/ - get to home/ |
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, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import registerServiceWorker from './registerServiceWorker'; | |
class TodoApp extends React.Component{ | |
constructor(props){ | |
super(props); |
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 TodoApp extends React.Component{ | |
constructor(props){ | |
super(props); | |
// Set initial state | |
this.state = { | |
items: ['Buy enchiladas', 'Buy Carrots', 'Buy Celery', 'add a form'] | |
}; | |
}; |
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 TodoList extends React.Component{ | |
constructor(props){ | |
super(props); | |
this.state = { | |
items: ['Buy enchiladas', 'Buy Carrots', 'Buy Celery'] | |
}; | |
} |
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, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import registerServiceWorker from './registerServiceWorker'; | |
class Todo extends React.Component { | |
constructor(props){ | |
super(props); | |
} |
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 ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import Counter from './Counter'; | |
import registerServiceWorker from './registerServiceWorker'; | |
ReactDOM.render(<div> | |
<app></app> | |
<counter></counter> |
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, { Component } from 'react'; | |
class Counter extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
count: 0 | |
} | |
} |
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
increment() { | |
this.setState((prevState) => { | |
return {count: prevState.count + 1} | |
}); | |
} | |
decrement() { | |
this.setState((prevState) => { | |
return {count: prevState.count - 1} | |
}); |
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
increment() { | |
alert("I've been incremented!"); | |
} | |
decrement() { | |
alert("I've been decremented!"); | |
} | |
render() { |
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
render() { | |
return ( | |
<div classname="App"> | |
<p>I am a: {this.state.job_title}</p> | |
<p>My favorite hobby is: {this.state.fav_hobby}</p> | |
<p>Count: {this.state.count}</p> | |
</div> | |
); | |
} |
NewerOlder