Skip to content

Instantly share code, notes, and snippets.

View jasonlucas907's full-sized avatar

Jason Lucas jasonlucas907

  • Denver, CO
View GitHub Profile

REACT ROUTER

docs

npm install rect-router-dom —save

-You can write routes in any component but, try to keep them in main App.js file.

BrowserRouter and Route,

FETCH-React

componentDidMount() {
   fetch('http://api.giphy.com/v1/gifs/trending?api_key=dc6zaTOxFJmzC')
   .then(response => response.json())
   .then(response => {
     this.setState({ gifs: response.data });
   })

.catch(error => {

CREATE REACT APP

npm docs

Install Create React App Globally

npm install -g create-react-app

http-server

npm docs

npm install http-sever -g

This will serve as an easy to use get around for ajax calls on a file.

In terminal

NPM - Node Modules docs.npmjs.com

List all commands

npm

Global Install

Proptypes

Install PropTypes

-npm install prop-types —save

Import to project

REACT COMPONENT STRUCTURES

React Component with state

import React, { Component } from 'react'; import './App.css';

class App extends Component {

AXIOS GET FUNCTION

npm docs

$(document).ready(function() {
  axios.get('https')
    .then(response => {
      allImages(response.data.data)
    })

.catch(error => {

SQL - Sequel

SQL is alnguage to get and manipulate date from a database like PostgreSQL.

Data Types:(not all)


-text
-numeric
-date

Queries