How to install react-native-fs in a Mendix Pluggable Native Widget

0
Hello Mendix Community,   I'm working on a Mendix Pluggable Native Widget, and I need to use the react-native-fs package for file system operations. I've already done the following: Created a file with the same name as the widget XML, e.g., MyWidgetName.js. Added the nativeDependency entry in the package.json file for the widget. Tried importing react-native-fs in my component code. However, it’s still not working — the package either doesn't get linked correctly or throws an error during build/runtime.   Thanks in advance for any help or guidance!
asked
1 answers
0

Any particular reason you need react-native-fs? I used to have it in my NativeFileDocuments module but the orginal library is no longer maintained and the most active fork does not work well in the Mendix native template. I switched to react-native-blob-util. It has pretty much all the functionality of react-native-fs. Bonus is that it is already in the native template and the Make It Native app so you don't need custom builds. Make sure to keep the version in the widget the same as used in the Mendix native template.

 

Link below is for the Mendix 10.18 version of the template

https://github.com/mendix/native-template/blob/release/11.x.x/package.json

 

 

answered