Skip to content

Instantly share code, notes, and snippets.

View Kailash23's full-sized avatar
👩‍🚀
Fall in love with the process ...

Kailash Uniyal Kailash23

👩‍🚀
Fall in love with the process ...
View GitHub Profile
@Kailash23
Kailash23 / collapsable.js
Created November 30, 2020 16:57 — forked from lukebrandonfarrell/collapsable.js
Collapsable header in React Native
import React, { useRef } from "react";
import { View, Animated, Image, ScrollView, Text } from "react-native";
const H_MAX_HEIGHT = 150;
const H_MIN_HEIGHT = 52;
const H_SCROLL_DISTANCE = H_MAX_HEIGHT - H_MIN_HEIGHT;
const CollapsibleHeader = () => {
const scrollOffsetY = useRef(new Animated.Value(0)).current;
const headerScrollHeight = scrollOffsetY.interpolate({