GithubHelp home page GithubHelp logo

minalwws / react-presentation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robrich/react-presentation

0.0 2.0 0.0 24 KB

Created for teaching React at a meetup

JavaScript 92.83% HTML 7.17%

react-presentation's Introduction

React Presentation for Phoenix JavaScript

Prerequisites

  • Know npm and JavaScript (intermediate-level)
  • Know command-line
  • Know Git

Contents

Treat each of these folders as it's own web root. Each one will need an npm install. You can run a server if you wish, or each index.html can simply be opened in a browser. Remember to install webpack globally: npm install -g webpack

1. Hello World

  • Webpack (without Babel (ES6) or React)
  • Source Maps

Install

cd path/to/example
npm install
webpack
open index.html

Open bundle.js file, scroll to the bottom and see the "Hello World" code wrapped in a bunch of code you didn't write (which came from Webpack)

2. First React Component

  • React
  • ES6 with Babel
  • React with JSX

Install

cd path/to/example
npm install
webpack
open index.html

What is JSX?

// JSX
<FirstComponent />

// React
React.createElement('div', null, 'Hello World');

// JS
var e = document.createElement('div');
e.innerHtml = 'Hello World'

3. Props

  • Webpack Resolve ./app
  • Webpack Watch (this is implemented via command line, see below)
  • Concept: Sub Components

Install

cd path/to/example
npm install
webpack -w
open index.html

4. React Router

  • React Router
  • Gulp
  • Webpack
  • gulp-server
  • Concept: browserHistory

Install

cd path/to/example
npm install
gulp

Visit http://localhost:8000

5. App Component

  • No new tools, install same as last example
  • Concept: Re-usable layout (App Component)

Visit http://localhost:8000

6. Data without Redux

  • JSON Server (just so we have a RESTful API for demo purposes)
  • Axios (a popular XHR tool using promises)
  • Concepts: Component Containers

Install

cd path/to/example
npm install
gulp

Visit http://localhost:3000 for database

Visit http://localhost:8000 for web app

7. Redux

  • Redux
  • Redux-Thunk
  • Concepts: Stores, Reducers, Actions, Dispatch, Subscribe

Install

cd path/to/example
npm install
gulp

Visit http://localhost:8000

8. react-redux

  • react-redux
  • Concepts: Provider, storeSelector, connect

Install

cd path/to/example
npm install
gulp

Visit http://localhost:8000

Resources

react-presentation's People

Contributors

bradwestfall avatar

Watchers

James Cloos avatar Liwei 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.