React-Native import/export library - react-native

so I am working on a React-Native app and I can't find proper library for import and export where i can select the directory i wanna save or chose my files.
I've already tried react-native-fs but it didn't quite do the job.
Basically I want something like pop box where I can select from where I want to import that file.

Related

How to manually link React Native new components with expo?

Right now I am trying to add sqlite-storage(https://github.com/andpor/react-native-sqlite-storage) and react-native-fs(https://github.com/itinance/react-native-fs/) to a project being done in react-native. Both, however, require me to add some lines of code to the ios and android files. Case is, I created this project using expo, and expo doesn't seem to have those files available.
Currently, I am trying to create some sort of offline storage for my app (I think I'll ditch sqlite because it won't be as necessary and just keep the react-native-fs and write the data on JSON).
I have already tried linking and re-installing it many times and it doesn't seem to work, since it keeps returning the "RNFSManager is undefined" error when I use react-native-fs. A few of the people with this problem I found said they had to manually link, but they all had access to those files I don't have (like setting and gradle, things expo doesn't give me direct access to), so I am not sure what I should do.
SQLite and FileSystem are both included on expo.
First you need to add them to your project with:
expo install expo-sqlite
expo install expo-file-system
Then you only need to import them
import { SQLite } from 'expo-sqlite';
import * as FileSystem from 'expo-file-system';
For more info you can check the expo docs for
FileSystem
and
SQLite
You will need to eject your expo project, so the android and ios folder will be created.
After that, you will be able to add nativecode to your react-native app.
The expo documentation is nicely done, you will have all the infos about the pros and cons of ejecting

How can I export Realm database to a file in react native?

I am building a react native app using Realm database. I want to export the realm database to a single file and then later import that file by another mobile device. How can I export and import Realm database in react native?
This currently does not allow files to be exported via code within the React-native. The Realm module does not currently have that capability.
However, you can move the file yourself, copy it, and put it in the Realm library in another project to check it on another device.
Or you can save the file and then use the Realm studio program to check the data.
file path

Icons do not appear when I use react-native-vector-icons

I am trying to use react-native-vector-icons in my project(react-native in android), however every icon I try to use stays with(?) Instead of the icon, I followed the installation correctly, I don't know what is going on.
How I am trying to use the icon (there is no compilation error):
import Icon from 'react-native-vector-icons/Ionicons'
After adding the module (yarn add), try to execute react-native link on the command line before building the app.
read more here:
https://www.reactnative.guide/12-svg-icons-using-react-native-vector-icons/12.0-intro.html

Share extension react native - expo

I have created a react-native app using expo. Now I am looking for share-extension to the app to import CSV data from email attachment to my app.
I have tried npm package but that does not work for me(I was not able to build my project with that npm package in Xcode)
I think react-native or expo does not have any share API
In this picture, you can see how he got the option to import data into the app.
I understand that without share extension API, I think react-native and Expo both are useless because you can create the app but you don't expand it.
Looking for the solution or any other alternate solution.
I'm afraid this is not possible with expo.
First of all, are you looking for a way to create your own extension, or do you just want your app to be in the "open with list" that you have in the screenshot on the right? (Sharing and "open with" are two distinct things.)
If you just want your app to be listed in the standard "open with list", you do not need to use github.com/alinz/react-native-share-extension since it serves a different purpose. To quote the repo:
This is a helper module which brings react native as an engine to drive share extension for your app.
So with the package you can use react native to create your own share extension
To get your app into the "open with list", you need to go to target settings and change it according to the screenshot (example for MS word). Read more about it here. However, I'm afraid you won't be able to do this with expo without ejecting.
How to get the url of the file in react-native? You need to make sure that libRCTLinking.a is in the Link Binary with Libraries in Xcode (it'll probably be there already). And then you can follow the docs and call Linking.getInitialURL to get the file url. Then it really depends on what you want to do with the file. If you need something complicated, you'll likely need to write native code. If you just want to upload the file to some server, then you can make use of blob support that was added to RN 0.54 in this commit. An example of how to use the blob support is here.

How to disable Visual Studio Code changes import automatically on React Native?

I am using VS Code with React Native extension. I do not remember what it asked but I unfortunately clicked yes to the prompted question and form that point VS Code is changing the import of react and react-native paths to exact location in node_modules folder.
It is quite annoying and I cannot find how to disable it.
Does anyone know how to stop automatic changing of import lines on VS Code?
You can find the configurations at User Settings.
File -> Preferences -> Settings
At there, you can remove the ones you want to reset.