Skip to content

Instantly share code, notes, and snippets.

View browniefed's full-sized avatar
🎧
Building

Jason Brown browniefed

🎧
Building
View GitHub Profile
// Master Nav Setup
const Main = StackNavigator(
{
Landing: {
screen: LandingScreen,
},
SignIn: {
screen: SignInScreen,
import React, { Component } from "react";
import { View, Text, StyleSheet } from "react-native";
class componentName extends Component {
_scrollEnabled = false;
enable = () => {
this._scrollEnabled = true;
this._scrollView.setNativeProps({
const keyMe = (key) => ({ key, specialId: key})
<Comp {...keyMe(key)} />
{ "swagger": "2.0",
"info": {
"title": "Loan Application API V2",
"version": "v2"
},"basePath":"/","tags":[{"name":"Loan Application API v2"},{"name":"Loan Application Document API v2"}],"paths":{"/loan/{loanUuid}/document":{"get":{"tags":["Loan Application Document API v2"],"summary":"Return documents associated with a loan.","description":"","operationId":"index","produces":["application/json"],"parameters":[{"name":"loanUuid","in":"path","required":true,"type":"string","x-example":"318120e7-9a8b-4f69-871e-ee06fed7419b"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Loan Documentation"}}},"security":[{"Mirador API Token.":[]}]}},"/loan/{loanUuid}/document/{documentUuid}/download":{"get":{"tags":["Loan Application Document API v2"],"summary":"Download a loan document. Response is binary data, with an associated content-type.","description":"","operationId":"download","produces":["*/*"],"parameters":[{"name":"loanUuid","in":"path","required":true,"type"
{
"Create Panresponder": {
"prefix": "pancreate",
"body": [
"PanResponder.create({",
" onStartShouldSetPanResponder: (evt, gestureState) => true,",
" onMoveShouldSetPanResponder: (evt, gestureState) => true,",
" onPanResponderGrant: (e, gestureState) => {",
" ",
" },",
import React, { Component } from 'react';
import {AppRegistry, View, StyleSheet, Animated, Easing } from 'react-native';
export default class animatedbasic extends Component {
componentWillMount() {
this.animatedValue = new Animated.Value(1);
}
componentDidMount() {
Animated.timing(this.animatedValue, {
const mapDispatchToProps = {
startup: Something.startup,
slower: Something.slower
}
const mergeProps = (stateProps, dispatchProps, ownProps) {
return {
...ownProps,
...stateProps,
...dispatchProps,

RN mask link https://github.com/text-mask/text-mask/blob/reactNativeMasks/reactnative/src/reactNativeTextMask.js

The reason why text-mask is better than others is it doesn'y rely on onKeyUp or any key events. This makes it much more reliable on mobile devices w/ Samsung generally screwing events up w/ custom browser crap they build on top of chrome.

It only deals with previous value, next value, and cursor position.

Those are all typically accessible in onChange (sync) which allows us to make reliable updates for the value, as well as the new cursor position. In RN they are 2 separate calls. So it makes it a little more difficult as rather than onChange things need to be handled in onSelectionChange

{
"MSFT":[
{
"date":"Jan 2000",
"value":39.81
},
{
"date":"Feb 2000",
"value":36.35
},
==83043== Memcheck, a memory error detector
==83043== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==83043== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==83043== Command: /usr/local/bin/node node_modules/.bin/mocha test
==83043== Parent PID: 80637
==83043==
--83043--
--83043-- Valgrind options:
--83043-- -v
--83043-- --tool=memcheck