You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import * as FileSystem from 'expo-file-system';
import { InteractionManager } from 'react-native';
import { fileAsyncTransport, logger } from 'react-native-logs';
const consoleLog = logger.createLogger({
transport: fileAsyncTransport,
transportOptions: {
FS: FileSystem,
fileName: `logs_${new Date().toLocaleDateString()}.txt`,
},
asyncFunc: InteractionManager.runAfterInteractions,
});
But now it's complaining that
error TS2322: Type 'typeof import("C:/p/expo-experiments/node_modules/expo-file-system/build/index")' is not assignable to type 'RNFS | EXPOFS'.
Type 'typeof import("C:/p/expo-experiments/node_modules/expo-file-system/build/index")' is missing the following properties from type 'EXPOFS': DocumentDirectoryPath, appendFile
The text was updated successfully, but these errors were encountered:
Same issue with RNFS, the type definitions in fileAsyncTransport.ts don't appear to be correct.
TS2322: Type
typeof import("/Users/{name}/IdeaProjects/pop/node_modules/react-native-fs/index")
is not assignable to type RNFS | EXPOFS
Type
typeof import("/Users/{name}/IdeaProjects/pop/node_modules/react-native-fs/index")
is missing the following properties from type RNFS: documentDirectory, writeAsStringAsync
I think having custom type definitions to enforce using a particular package won't really work as you'll constantly need to update it as the packages update. In my opinion you'd either have to import both of those packages and do typeof (if possible) or revert to any?
This example used to work
But now it's complaining that
The text was updated successfully, but these errors were encountered: