Today I Learned

TIL, 2018-03-21, Deploying Transcripto and Practicing React change states

Musings, React:

class Player extends React.Component {
  constructor() {
    super()

    this.state = { score: 0 }
  }

  increaseScore() {
    // 1. Get previous state from this.state
    this.setState({ score: this.state.score + 1 })

    // 2. Get previous state from the callback function
    this.setState((prevState) => {
      return { score: prevState.score + 1 }
    })
  }
}
  • Warning: ChildComponent(...): childContextTypes cannot be defined on a functional component.: I’ll get back to this later.

Musings, Deployment

Set the damn RVM type lol.

  • sudo apt-get install nodejs
  • sudo apt-get install npm
  • sudo apt-get install yarn
set :rvm_type, :user
set :rvm_ruby_version, '2.4.1'

This project is maintained by daryllxd