Skip to content

Instantly share code, notes, and snippets.

View browniefed's full-sized avatar
🎧
Building

Jason Brown browniefed

🎧
Building
View GitHub Profile

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

const mapDispatchToProps = {
startup: Something.startup,
slower: Something.slower
}
const mergeProps = (stateProps, dispatchProps, ownProps) {
return {
...ownProps,
...stateProps,
...dispatchProps,
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, {
{
"Create Panresponder": {
"prefix": "pancreate",
"body": [
"PanResponder.create({",
" onStartShouldSetPanResponder: (evt, gestureState) => true,",
" onMoveShouldSetPanResponder: (evt, gestureState) => true,",
" onPanResponderGrant: (e, gestureState) => {",
" ",
" },",
{ "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"
const keyMe = (key) => ({ key, specialId: key})
<Comp {...keyMe(key)} />
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({
// Master Nav Setup
const Main = StackNavigator(
{
Landing: {
screen: LandingScreen,
},
SignIn: {
screen: SignInScreen,
const NavItem = styled.li(
{
margin: "15px 0",
},
({ sub }) => ({
fontSize: ".8rem"
}),
);
<NavItem sub />
import React from "react";
import { render } from "react-dom";
import { BrowserRouter, Switch, Route } from "react-router-dom";
import RenderTo from "./render_to";
import Header from "./components/header";
import Nav from "./components/nav";
import Home from "./pages/home";
import AccountsReview from "./pages/accounts_review";