React

Updated: 2021-11-19

Source Code

Ecosystem

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+.

GraphQL and Relay

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

Integrate with GraphQL.

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)}

        />