In this doc, we'll explore two popular libraries: axios
and isomorphic-fetch
.
Quick facts:
- 37,439 stars on GitHub
- 130 contributors
- most recent commit: March 8th, 2018
- created in Aug. 2014
#### npm install --global yarn | |
Josephs-MacBook-Pro:~ josephprevite$ npm install --global yarn | |
npm WARN deprecated [email protected]: It is recommended to install Yarn using the native installation method for your environment. See https://yarnpkg.com/en/docs/install | |
/usr/local/bin/yarnpkg -> /usr/local/lib/node_modules/yarn/bin/yarn.js | |
/usr/local/bin/yarn -> /usr/local/lib/node_modules/yarn/bin/yarn.js | |
+ [email protected] | |
updated 1 package in 0.929s | |
Josephs-MacBook-Pro:~ josephprevite$ brew install yarn |
Josephs-MacBook-Pro:call-forwarding-node-master josephprevite$ yarn start | |
yarn run v1.3.2 | |
$ node ./bin/www | |
::1 - - [14/Dec/2017:02:15:35 +0000] "GET / HTTP/1.1" 200 1172 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36" | |
::1 - - [14/Dec/2017:02:15:35 +0000] "GET /static/css/main.css HTTP/1.1" 404 158 "http://localhost:3000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36" | |
::1 - - [14/Dec/2017:02:15:36 +0000] "GET /static/css/main.css HTTP/1.1" 404 158 "http://localhost:3000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36" | |
::1 - - [14/Dec/2017:02:15:36 +0000] "GET /favicon.ico HTTP/1.1" 404 150 "http://localhost:3000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36" | |
::1 - - [14/Dec/2017:02:15:44 +0000] "GET /stati |
<!-- Global site tag (gtag.js) - Google Analytics --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-TRACKING-CODE"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', 'UA-10563834-2'); | |
</script> |
function computeArea(width, height) { | |
return width * height; | |
} | |
function celsToFahr(celsTemp) { | |
// your code here | |
return celsTemp * (9/5) + 32; | |
} | |
function fahrToCels(fahrTemp) { |
import React from 'react'; | |
import './add-form.css'; | |
//First, we create a class component called AddForm | |
export default class AddForm extends React.Component { | |
constructor(props) { | |
super(props); | |
//when we define the state, we want to set a default value for text because we want to control the input. |
//To give some context, this is an example taken from Thinkful's curriculum. This section of the curriculum uses a simple React app that creates a clone of Trello. | |
//We will be looking at two components: an AddForm component (child) and a List component (parent) | |
//This gist aims to show how we pass data from the child component to the parent component. I will do this by adding in comments throughout the code for each component. | |
//The code for the child component. | |
import React from 'react'; | |
import './add-form.css'; |
In this doc, we'll explore two popular libraries: axios
and isomorphic-fetch
.
Quick facts:
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |