Skip to content

Instantly share code, notes, and snippets.

import React, { Component } from 'react';
import {
Platform, KeyboardAvoidingView, Modal
} from 'react-native';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { NavigationActions, StackActions } from 'react-navigation';
import {
bulkUpdate, updateAgentCode,
} from '../actions/bulkParcelUpdate';
@hewrin
hewrin / example_fetch.js
Created May 20, 2018 14:50
Using fetch with React on Rails
function login(formData) {
let header = { "Content-Type": "application/x-www-form-urlencoded" }
return fetch('${USER_API_URL}/login',
{ headers: ReactOnRails.authenticityHeaders(header),
body: formData, method: "POST" })
.then(res => res.status).catch(err => console.error(err)); }
}