Skip to content

Instantly share code, notes, and snippets.

View gorhom's full-sized avatar
😴
reach out to me on twitter.

Mo Gorhom gorhom

😴
reach out to me on twitter.
View GitHub Profile
@gorhom
gorhom / BottomSheetModal.tsx
Created September 21, 2020 18:34
Bottom Sheet Modal
import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from 'react';
import { SafeAreaView, StyleSheet, Text, View } from 'react-native';
import BottomSheet from '@gorhom/bottom-sheet';
import { SafeAreaProvider } from 'react-native-safe-area-context';
@gorhom
gorhom / CustomIcon.tsx
Created May 23, 2020 09:06
Animated TabBar custom svg icon for each state
import * as React from 'react';
import Animated, {not, greaterOrEq} from 'react-native-reanimated';
import Svg, {Path, PathProps} from 'react-native-svg';
import {BubbleTabIconProps} from '@gorhom/animated-tabbar';
const AnimatedPath = (Animated.createAnimatedComponent(
Path,
) as any) as React.ComponentClass<
Animated.AnimateProps<{}, PathProps & {style?: any}>
>;
@gorhom
gorhom / build-time-improvements.md
Created December 10, 2019 11:53 — forked from kelset/build-time-improvements.md
This is kind of a blogpost about my experience of diving deep to improve some timings for an iOS React Native app

Improving times for both iOS build and CI for a React Native app

Intro

Hello there.

So, if you are here you probably saw my previous tweet where I asked for tips & tricks on improving the timing on an iOS/React Native app build time.

What will follow was how I mixed those suggestions + some good old GoogleSearch-fu + me deep diving on this for ~2 days.

import React, { useRef, useState } from 'react'
import { View, Text, StyleSheet } from 'react-native'
import BottomSheet from 'reanimated-bottom-sheet'
import { FlatList } from 'react-native-gesture-handler'
import { Fragment } from 'react'
const data = Array(50)
.fill(0)
.map((item, index) => ({
id: `item-${index}`,
@gorhom
gorhom / utils.js
Created August 14, 2019 14:26
Android Devices/Emulators JS Helper
const { exec } = require('@tunnckocore/execa')
/**
* Get connected Android devices / emulators list.
* @returns {Promise<Array>} Promise<devices[]>
*/
const getConnectedAndroidDevices = () =>
exec(['adb devices'], {
preferLocal: true,
}).then(output => {