Skip to content

Instantly share code, notes, and snippets.

View kelleyvanevert's full-sized avatar
🦕
would like a pet dino

Kelley van Evert kelleyvanevert

🦕
would like a pet dino
View GitHub Profile
@kelleyvanevert
kelleyvanevert / README.md
Created May 22, 2021 10:43
Custom implementation of useQueryParams

This is a custom implementation of use-query-params, which has served me quite well for about two years, but was getting more and more comprehensive w/ features & a level of abstraction I didn't really need, while also somehow messing up my build process. (The latter is mostly my own fault though, due to my setup w/ SSR, react-ssr-prepass, and trying to keep most of the server code within the webpack output instead of using a generous nodeExternals setting because of the way our CD setup works currently.. But, nonetheless, use-query-params seemed to be a hassle, haha.)

  • No duplicate query params, just a single one. If you want an array, use e.g. StringArrayParam
  • No null vs undefined, or "existent w/o value" vs "inexistent", difference. The query param is either there, or isn't there, and what value is takes depends on the type config.
@kelleyvanevert
kelleyvanevert / MinScoreSlider.tsx
Created November 10, 2022 10:18
React Native Reanimated
import React from "react";
import { View, StyleSheet, Dimensions } from "react-native";
import { darken } from "polished";
import Animated, {
useAnimatedStyle,
Extrapolate,
useSharedValue,
useAnimatedProps,
interpolate,
useAnimatedGestureHandler,