Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/fiber/src/native/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import * as THREE from 'three'
import { Image, NativeModules, Platform } from 'react-native'
import { Asset } from 'expo-asset'
import * as fs from 'expo-file-system'
import { fromByteArray } from 'base64-js'
import { Buffer } from 'buffer'

// Conditionally import expo-file-system/legacy to support Expo 54
const getFileSystem = () => {
try {
return require('expo-file-system/legacy')
} catch {
return require('expo-file-system')
}
}
const fs = getFileSystem()

// http://stackoverflow.com/questions/105034
function uuidv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
Expand Down