This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createContext, forwardRef, useCallback, useMemo } from "react"; | |
| import { FlatList, FlatListProps, ViewToken } from "react-native"; | |
| import Animated, { useSharedValue } from "react-native-reanimated"; | |
| const MAX_VIEWABLE_ITEMS = 4; | |
| type ViewabilityItemsContextType = string[]; | |
| export const ViewabilityItemsContext = createContext< | |
| Animated.SharedValue<ViewabilityItemsContextType> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useEffect, useRef } from "react"; | |
| import { AppState, AppStateStatus } from "react-native"; | |
| export const useFetchOnAppForeground = () => { | |
| const listener = useRef(null); | |
| function fetchOnAppForeground(params) { | |
| if (AppState.currentState === "active") { | |
| return fetch(params); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {useRef, useState} from 'react'; | |
| import {FlatList, Image, useWindowDimensions} from 'react-native'; | |
| import {Gesture, GestureDetector} from 'react-native-gesture-handler'; | |
| import Animated, {useSharedValue} from 'react-native-reanimated'; | |
| // array of 3 images | |
| const images = [ | |
| {id: 1, url: 'https://picsum.photos/id/237/200/300'}, | |
| {id: 2, url: 'https://picsum.photos/id/238/200/300'}, | |
| {id: 3, url: 'https://picsum.photos/id/239/200/300'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Layout and Text components are my own utility components. Replace them by your own. */ | |
| import { memo, useEffect, useMemo, useState } from "react"; | |
| import { ViewStyle } from "react-native"; | |
| import { A } from "@mobily/ts-belt"; | |
| import mitt from "mitt"; | |
| import { v4 as uuid } from "@lukeed/uuid"; | |
| import Animated, { | |
| Layout as REALayout, | |
| Easing, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { withXcodeProject } = require('@expo/config-plugins') | |
| const findFileReferenceByName = (xcodeProject, fileName) => { | |
| const fileReferences = xcodeProject.hash.project.objects['PBXFileReference'] | |
| return Object.fromEntries( | |
| Object | |
| .entries(fileReferences) | |
| .filter(([key, value]) => value.name === `"${fileName}"`) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ExpoModulesCore | |
| import SwiftUI | |
| class DraggableProps: ExpoSwiftUI.ViewProps { | |
| @Field var text: String | |
| } | |
| struct DraggableView: ExpoSwiftUI.View { | |
| @EnvironmentObject var props: DraggableProps | |
| var body: some View { |
OlderNewer