Skip to content

Instantly share code, notes, and snippets.

@sloanwolf
sloanwolf / KeyboardHandler.js
Last active October 30, 2016 05:47 — forked from tahaziadeh/KeyboardHandler.js
Keyboard spacing solution for react-native based on the stackoverflow answer http://stackoverflow.com/a/33585501/1783214
// Based on dbasedow/KeyboardHandler.js
/**
* Based on http://stackoverflow.com/a/33585501/1783214
*
* Handle resizing enclosed View and scrolling to input
* Usage:
* <KeyboardHandler ref='kh' offset={50} >
* <View>
* ...
* <TextInput ref='username'
@sloanwolf
sloanwolf / paho.mqtt.node.js
Last active July 13, 2016 17:08
Modified Paho MQTT JS so it can be required in Node
/*******************************************************************************
* Copyright (c) 2013 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
@sloanwolf
sloanwolf / ReactNativeChatScreenExample.js
Last active April 3, 2023 04:27
React-Native Chat screen with bottom TextInput
/*
* Below is a bare functioning example of how I made a React-Native Chat messaging component that shifts the input up when
* the keyboard is active, and scrolls back down when the keyboard is inactive from a TextInput blur.
*
* The only thing I haven't been able to figure out yet is getting the ListView to render from the bottom, not sure if it's
* possible yet via styles.
*
* NOTE: This uses from iOS-only properties
*/