Skip to content

Instantly share code, notes, and snippets.

import React, {Suspense, useRef, useState} from 'react';
import {Button, SafeAreaView, View, Text, ScrollView} from 'react-native';
let cache = new Map();
function fetch(key) {
if (!cache.has(key)) {
cache.set(key, getData(key));
}
return cache.get(key);
import { render, screen, fireEvent } from '@testing-library/react-native';
import MyButton from '../components/myButton';
import React, { useRef } from 'react';
// jest.mock("react", () => {
// return {
// ...jest.requireActual('react'),
// useRef: jest.fn()
// }
// });
import React from 'react';
import {Button, SafeAreaView, Text} from 'react-native';
import {Image} from 'expo-image';
import Animated from 'react-native-reanimated';
const AnimatedImage = Animated.createAnimatedComponent(Image);
const SQUARE_POST_HEIGHT = 200;
const SQUARE_POST_WIDTH = 200;
const thumbnail_url =
import { Freeze } from 'react-freeze';
function SomeComponent({ shouldSuspendRendering }) {
return (
<Freeze freeze={shouldSuspendRendering}>
<MyOtherComponent />
</Freeze>
);
}
import { Freeze } from 'react-freeze';
function SomeComponent({ shouldSuspendeRendering }) {
return (
<Freeze freeze={shouldSuspendeRendering}>
<MyOtherComponent />
</Freeze>
);
}
function SomeComponent({ shouldSuspendeRendering }) {
return (
<Freeze freeze={shouldSuspendeRendering}>
<MyOtherComponent />
</Freeze>
);
}
import { enableFreeze } from 'react-native-screens';
enableFreeze(true);
import React, { ReactElement, useState } from "react";
import Animated, {
useAnimatedRef,
useAnimatedScrollHandler,
useSharedValue,
} from "react-native-reanimated";
import Item from "./Item";
import { COL, Positions, SIZE } from "./Config";
import React, { ReactNode, RefObject, useEffect } from "react";
import { Dimensions, StyleSheet } from "react-native";
import Animated, {
useAnimatedGestureHandler,
useAnimatedStyle,
useAnimatedReaction,
withSpring,
scrollTo,
withTiming,
useSharedValue,
import Animated, {
useSharedValue,
useAnimatedReaction,
withTiming,
withDecay,
withRepeat,
withSequence,
withSpring,
withDelay,
useAnimatedRef,