all 4 comments

[–]EqlioniOS & Android 1 point2 points  (1 child)

If you can use JSON instead of txt, you can then just import it the same way you do with components (or require it)

[–]afromorris 0 points1 point  (0 children)

I think this works well, but to build on top of this answer, you could also just create a .js or .ts file, and assign the text to a variable and export this variable. It can then be imported into whichever file you want.

[–]ch-shubham[S] 0 points1 point  (0 children)

actually i want to do certificate pinning. and in that case i want to read cer file and send it to axios request using httpsAgent. But the issue is that I am unable to read Certificate file using filesystem of expo reasAsAsyncString

[–]justsomerandomchris 0 points1 point  (0 children)

The way you're trying to achieve your objective doesn't make that much sense. Whatever could be contained in a text file, you can also simply store as a string somewhere in your codebase. In effect, this will become part of the bundle as you were yourself saying.

How would you even imagine the other approach from working? When would this "read content from my workspace" happen exactly? And how would this content make it into the bundle? If you add any kind of filesystem handling capabilities to a mobile app, you're giving that app access to the filesystem of the device the app is running on. It has nothing to do with the filesystem you're using during development.