renative icon indicating copy to clipboard operation
renative copied to clipboard

React-native-fs used while migrating project throwing an error

Open anurastogi opened this issue 2 years ago • 2 comments

I am migrating my existing react-native project which runs on Android to Tizen. Within the project, I am using react-native-fs to read/write files to the device. However, when I use it within the Renative project, since it runs on the web browser for hot reload during development , I get an error : FS.common.js: Unexpected token, expected "," I have tried changing the engine to engine-rn to try to run the app on the emulator, but the engine does not support Tizen.

Please could you suggest where I am going wrong. Thanks!

anurastogi avatar Aug 29 '23 14:08 anurastogi

@anurastogi Thanks for reporting this issue, could you provide rnv and node versions, os type?

GabrieleKaceviciute avatar Oct 02 '23 06:10 GabrieleKaceviciute

Hello Gabriel,

OS type I was trying this for is Tizen. RNV version - 0.37.1 Node version - 14.18.0

Please let me know if you need any more information.

anurastogi avatar Oct 03 '23 04:10 anurastogi

Hello @anurastogi, Sorry for the late reply. Library react-native-fs only support Android, iOS, Mac (Catalyst), and Windows platforms. Renative can't change third party library so that it could support others platforms like for example Tizen. However, in Renative there is an option to make a component for specific platform: image This way you can encapsulate the component so it's only runs for that specific platform. That's how you can use libraries for specific platform.

Marius456 avatar Sep 12 '24 07:09 Marius456

Closing as answer has been provided, feel free to reopen if needed

GabrieleKaceviciute avatar Sep 20 '24 08:09 GabrieleKaceviciute