GithubHelp home page GithubHelp logo

willcode4food / hooks-workshop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from reacttraining/hooks-workshop

0.0 2.0 0.0 168 KB

The course material for our Spring 2019 React Hooks workshop

Home Page: https://reacttraining.com/workshops

JavaScript 93.98% CSS 5.37% HTML 0.65%

hooks-workshop's Introduction

Welcome to React Training!

This repo contains the course material for React Training. Before attending the training, please make sure you can run this repository.

Install

First, install git and the latest stable version of node. Then:

$ git clone https://github.com/ReactTraining/hooks-workshop.git
$ cd hooks-workshop
$ npm install
$ npm start

You'll be prompted with the exercise you'd like to run, hit "0" to view the full app we'll be working in, then, open a web browser to http://localhost:3000.

$ npm start

> [email protected] start ../hooks-workshop
> node scripts/start.js

Which exercise?

[1] 01-rendering
[2] 02-state
[3] 03-controlled-components
[4] 04-effects
[5] 05-data-loading
[6] 06-data-flow
[7] 07-compound-components
[8] 08-app-state
[9] 09-flicker
[a] 10-the-feed
[b] 11-animation
[c] 12-optimization
[0] THE FULL APP!

Choose one from list [1...9, a, b, c, 0]:

Updating

If you've already cloned the repo but you need to get updated code, then follow these steps:

  • First, cd into the root directory of the repo
  • Then do an ls command to ensure you see a package.json file listed. If you don't you're not in the root folder of the repo
  • Clear out any dirty files in your git working tree (git stash is a safe way to do it, git reset ---hard is how to live dangerously)
  • Then run these steps to get the updates:
git pull origin master
npm install

Then you should be able to do your npm start again.

Be Prepared

IMPORTANT: Please read our JavaScript Primer before attending the workshop. It's a refresher on some of the newer bits of JavaScript you'll want to be familiar with in order to get the most out of the experience.

Windows Machine?

We'll be running commands like the ones from the install/update instructions above. These are bash commands which means if you're on Windows you'll need a bash-enabled command-line tool. If you've installed Git For Windows then you'll have a command-line tool called Git Bash already. This seems to work out well for doing other bash things that aren't just git specific (like npm).

Troubleshooting

A few common problems:

  • You're having problems cloning the repository. Some corporate networks block port 22, which git uses to communicate with GitHub over SSH. Instead of using SSH, clone the repo over HTTPS. Use the following command to tell git to always use https instead of git:
$ git config --global url."https://".insteadOf git://

# This adds the following to your `~/.gitconfig`:
[url "https://"]
  insteadOf = git://
  • You're having trouble installing node. We recommend using nvm. nvm makes it really easy to use multiple versions of node on the same machine painlessly. After you install nvm, install the latest stable version of node with the following command:
$ nvm use default stable
  • You don't have permissions to install stuff. You might see an error like EACCES during the npm install step. If that's the case, it probably means that at some point you did an sudo npm install and installed some stuff with root permissions. To fix this, you need to forcefully remove all files that npm caches on your machine and re-install without sudo.
$ sudo rm -rf node_modules

# If you installed node with nvm (suggested):
$ sudo rm -rf ~/.npm

# If you installed node with Homebrew:
$ sudo rm -rf /usr/local/lib/node_modules

# Then (look ma, no sudo!):
$ npm install

License

This material is available for private, non-commercial use under the GPL version 3. If you would like to use this material to conduct your own workshop, please contact us at [email protected].

hooks-workshop's People

Contributors

alwaysmorehats avatar eshtadc avatar fnowinski avatar mjackson avatar ryanflorence avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.