I’m conditionally loading .js files in my expo project - meaning if the javascript file exists at compile time I’ll load them.
I’m using FileSystem to establish if a file exists, but it’s not working.
This is my code:
Hi @kashifceler. The FileSystem API is for files on the device, not source files. In addition, all your source files are bundled up into a single file when you publish, so I can’t think of a case where this would give you any useful information even if it was possible. Can you explain why you’re trying to do this?
Thanks for your reply. If the client_override directory exists I want to take the files from it and replace the default client directory files. In nodeJS I did this using the fs library - where I checked if the the directory existed, obviously fs can’t be used in react-native.
Ok, you won’t be able to use that same strategy but there are a bunch of approaches that would work. Still don’t understand exactly why you’re trying to do that. Seems like you could just replace the files in the client directory instead of using an additional directory?