Skip to content

Instantly share code, notes, and snippets.

@productioncoder
productioncoder / install-create-react-app.sh
Created August 30, 2018 11:56
Install create-react-app
npm i -g create-react-app
@productioncoder
productioncoder / scaffold-react-app.sh
Last active November 3, 2019 10:55
Scaffold a React app using create-react-app
npx create-react-app youtube-react
@productioncoder
productioncoder / setting-up-git-repo.sh
Last active November 3, 2019 10:54
Initialize and setup a git repo for a project created with create-react-app
cd youtube-react
git init
# connect your local repo to the repo on Github
git remote add origin git@github.com:<YOUR_REPO_NAME>.git
# add all files that create-react-app has created to the repository
git add -A
git commit -m "initial commit"
git push -u origin master
@productioncoder
productioncoder / start-app.sh
Created August 31, 2018 08:42
Starting the application
# you can also run npm start instead
yarn start
@productioncoder
productioncoder / App.js
Last active November 3, 2019 10:56
Cleanup App.js
import React, { Component } from 'react';
class App extends Component {
render() {
return (
<div>Hello World</div>
);
}
}
@productioncoder
productioncoder / commit-project-setup
Created August 31, 2018 09:57
Commit Project Setup
git add -A
git commit -m "project setup"
git push
@productioncoder
productioncoder / install-semantic-ui.sh
Created August 31, 2018 13:34
Installing Semantic UI in React
yarn add semantic-ui-react semantic-ui-css
@productioncoder
productioncoder / index.js
Created August 31, 2018 13:44
Import Semantic UI CSS
import 'semantic-ui-css/semantic.min.css';
// ...
@productioncoder
productioncoder / setup-scss.sh
Last active November 3, 2019 10:58
Installing dependencies for SCSS preprocessor
yarn add node-sass
@productioncoder
productioncoder / package.json
Created August 31, 2018 14:19
Update package.json to support SCSS
"scripts": {
"build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"build-js": "react-scripts build",
"build": "npm-run-all build-css build-js",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},