Skip to content

Instantly share code, notes, and snippets.

@shukerullah
shukerullah / Progress Bar.js
Last active September 3, 2022 14:27
React Native Animated Progress Bar
import PropTypes from 'prop-types';
import React from 'react';
import {
View,
Easing,
Animated,
StyleSheet,
Dimensions,
ViewPropTypes,
} from 'react-native';
@bvaughn
bvaughn / updating-external-data-when-props-changes-using-promises.js
Last active April 22, 2026 07:21
Example for loading new external data in response to updated props
// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_currentId = null;
state = {
externalData: null
};
@FaiChou
FaiChou / NotificationCenter.js
Last active April 3, 2018 15:02
A javascript notification for react-native
// FaiChou
// willMount add
// willUnmount remove
const __notices = []; // eslint-disable-line
const isDebug = true;
// register notification,name: notification name,selector: function for action to do,observer: type Object
export const addNotification = (name, selector, observer) => {
# When using RN in combination with Cocoapods, a lot of
# things are broken. These are the fixes we had to append
# to our Podfile when upgrading to ReactNative@0.55.3.
#
# WARNING: Check those line numbers when you're on a different version!
def change_lines_in_file(file_path, &change)
print "Fixing #{file_path}...\n"
contents = []