React

Updated: 2018-12-10

Facebook Open Source vs Community

Ecosystem

Create React App

https://github.com/facebook/create-react-app

A good starting point to build your own app. Created by Facebook.

React Routing

React + Express

Flux

Managing states, by Facebook.

https://code-cartoons.com/a-cartoon-guide-to-flux-6157355ab207 https://facebook.github.io/flux/docs/overview.html

Redux

A modified Flux, by community

https://redux.js.org/

Type Checking

  • propTypes: now moved to a separate package prop-types, for runtime type checking for React props.
  • Flow: the static type checker created by Facebook(meaning works pretty good with React). https://flow.org/
  • Typescript: created by Microsoft and became popular with Angular 2+.

Relay

https://facebook.github.io/relay/

Integrate with GraphQL.

React Native

Script

Use script to load Google Maps

import Script from 'react-load-script';

let url = "http://maps.googleapis.com/maps/api/js?key="; + process.env.GOOGLE_API_KEY
    return (
      <div className="GMap">
        <Script
          url={url}
          onCreate={this.handleScriptCreate.bind(this)}
          onError={this.handleScriptError.bind(this)}
          onLoad={this.handleScriptLoad.bind(this)}

        />

React Route