This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import axios from 'axios' | |
| const ADD_TOKEN = 'ADD_TOKEN'; | |
| const ITEMS = 'ITEMS'; | |
| export const addToken = (token) => ({ type: ADD_TOKEN, payload: token }); | |
| export const addDataItems = (data) => ({ type: ITEMS, payload: data }); | |
| // export function asyncCallItems(dispatch) { | |
| // return dispatch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Mac | |
| brew cask install android-sdk | |
| //Windows | |
| choco install android-sdk | |
| //Linux | |
| //Con sudo | |
| $ npm install -g create-react-native-app | |
| # or | |
| $ yarn global add create-react-native-app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yarn global add gatsby-cli | |
| gatsby new gatsby-example https://github.com/gatsbyjs/gatsby-starter-hello-world | |
| cd gatsby-example | |
| yarn add react react-domx | |
| //Deploy | |
| yarn global add surge | |
| o | |
| yarn global add now | |
| => Windows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // "sync.gist": "94b54e6671ef3e2d752a40e359a2137a" | |
| "window.zoomLevel": 2, | |
| "workbench.colorTheme": "Night Owl", | |
| "workbench.iconTheme": "material-icon-theme", | |
| "workbench.startupEditor": "newUntitledFile", | |
| "emmet.triggerExpansionOnTab": true, | |
| "emmet.includeLanguages": { | |
| "javascript": "javascriptreact", | |
| "erb": "html" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** | |
| CREATE input | |
| ***/ | |
| <input | |
| type="email" placeholder="Email" | |
| value={this.state.email} | |
| onChange={this.handleEmailChange} | |
| required autoFocus | |
| ref="emailTest" | |
| /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Layout from '../components/MyLayout.js' | |
| import Link from 'next/link' | |
| // import fetch from 'isomorphic-unfetch' | |
| import axios from 'axios' | |
| const Index = (props) => ( | |
| <Layout> | |
| <h1>Batman TV Shows</h1> | |
| <ul> | |
| {props.data.map(({show}) => ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| localStorage.setItem('key', value) | |
| axios.post | |
| $.post("/authenticate", {email: userEmail, password: userPassword}, function(data) { | |
| localStorage.setItem('token', data.token) | |
| }); | |
| localStorage.getItem('key') | |
| Ajax example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import './App.css'; | |
| import List from './List'; | |
| export default class App extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| term: '', | |
| items: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import axios from 'axios'; | |
| class Form extends React.Component { | |
| state = { | |
| name: '', | |
| email: '', | |
| message: '', | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const addMessage = message => { | |
| return { | |
| type: "ADD", | |
| message: message | |
| }; | |
| }; | |
| const mapStateToProps = state => { | |
| return { | |
| messages: state |
OlderNewer