Skip to content

Instantly share code, notes, and snippets.

View smontlouis's full-sized avatar

Montlouis-Calixte Stéphane smontlouis

  • Freelance
  • Annecy
View GitHub Profile
diff --git a/src/dom/dom-entry.tsx b/src/dom/dom-entry.tsx
index 43a920aa9d1ec3457b070aeaa9adcfbca844614d..c39c3bc0d94f85a3c2b9effd9b8179c5caadb7a7 100644
--- a/src/dom/dom-entry.tsx
+++ b/src/dom/dom-entry.tsx
@@ -57,11 +57,6 @@ export function registerDOMComponent(AppModule: any) {
function DOMComponentRoot(props) {
// Props listeners
const [marshalledProps, setProps] = React.useState(() => {
- if (typeof window.$$EXPO_INITIAL_PROPS === 'undefined') {
- throw new Error(
@smontlouis
smontlouis / FadingLooper.tsx
Created December 16, 2024 14:46
expo-av audio fade
import {
AVPlaybackStatus,
AVPlaybackStatusError,
AVPlaybackStatusSuccess,
Audio,
} from 'expo-av'
import { Platform } from 'react-native'
const FADE_DURATION = 600
@smontlouis
smontlouis / AuthProvider.tsx
Created December 5, 2024 15:29
PowerSync React-native
import React, { useContext, createContext, useState, useEffect } from 'react'
import { Session, User } from '@supabase/supabase-js'
import { useSystem } from './system'
interface AuthProviderProps {
children: React.ReactNode
}
type AuthContextType = {
session: Session | null
@smontlouis
smontlouis / InteractiveLottie.tsx
Last active November 15, 2024 11:16
Interactive lottie
import LottieView from 'lottie-react-native'
import Animated, {
makeMutable,
useAnimatedProps,
useAnimatedStyle,
useFrameCallback,
useSharedValue,
withTiming,
} from 'react-native-reanimated'
import { Button, XStack } from 'tamagui'
@smontlouis
smontlouis / AnimatedAudioLines.tsx
Created October 30, 2024 12:21
Animated audio lines
import { UseThemeResult } from '@tamagui/core'
import React from 'react'
import Animated, {
Easing,
SharedValue,
interpolateColor,
useAnimatedStyle,
useDerivedValue,
useSharedValue,
withRepeat,
@smontlouis
smontlouis / SplitScreen.tsx
Created November 13, 2023 06:53
Amie in-app split screen in react-native
import { useWindowDimensions } from 'react-native'
import { Gesture } from 'react-native-gesture-handler'
import Animated, {
Extrapolation,
WithSpringConfig,
interpolate,
scrollTo,
useAnimatedRef,
useAnimatedScrollHandler,
useAnimatedStyle,
@smontlouis
smontlouis / SeemlessLooper.ts
Last active October 20, 2024 13:00
seemless / gapless loop crossfade solution with expo-av
import {
AVPlaybackSource,
AVPlaybackStatus,
AVPlaybackStatusError,
AVPlaybackStatusSuccess,
Audio,
} from 'expo-av'
const FADE_DURATION = 4000
@smontlouis
smontlouis / react-query-lite.tsx
Last active November 22, 2023 17:37
React Query Lite
import React from 'react'
import { usePrevious } from './usePrevious'
export type QueryStatus = 'idle' | 'loading' | 'error' | 'success'
type QueryClientProviderProps = {
children: React.ReactNode
client: QueryClient
}
const lunr = require('lunr')
require('lunr-languages/lunr.stemmer.support')(lunr)
require('lunr-languages/lunr.fr')(lunr)
require('./lunr.unicodeNormalizer')(lunr)
var idx = lunr(function () {
this.use(lunr.fr)
this.use(lunr.unicodeNormalizer)
...
import glamorous from 'glamorous'
const Row = glamorous.div(({ extended }) => ({ // THIS IS OK
position: 'relative',
maxWidth: extended ? 1330 : 1200,
margin: '0 auto',
boxsizing: 'border-box',
display: 'flex',
flexDirection: 'row',
flexWrap: 'wrap',