ReactJS Cheatsheets - adonisv79/bytecommander.com GitHub Wiki

Requirements

  • npm installed

CLIs

Create new app

npx create-react-app {appname}

Start App

npm start

Build app for deploy (result will be in 'build' folder

npm run build

Sample App Template

import React, { Component } from 'react';

export default class Game extends Component {

  constructor(config, state) {
    super();
    console.log('component created');
  }
  componentDidMount() {
    console.log('component mounted');
  }
  componentWillUnmount() {
    console.log('component unmounted');
  }

  render() {
    console.log('component rendered');
    return <h1>Hello World</h1>
  }
}
⚠️ **GitHub.com Fallback** ⚠️