React-native : null is not an object(evaluating 'RNFSMANAGER.RNFSFileTypeRegular')

Bha*_*ora 6 react-native

I am getting this error as soon as I add this line to my App.js in react-native project.

import * as RNFS from 'react-native-fs';
Run Code Online (Sandbox Code Playgroud)

null is not an object(evaluating 'RNFSMANAGER.RNFSFileTypeRegular')

I am attaching the screens that I get. First I get :

在此处输入图片说明

then it quickly converts into :

在此处输入图片说明

I also tried to link react-native fs using:

在此处输入图片说明

I don't know if i have to do this but when I try to do yarn add react-native-fs.

在此处输入图片说明

Though I was able to do : 在此处输入图片说明

hon*_*lop 0

看起来您已经完成了完美的安装。如果您的链接成功且没有错误,您可以尝试此操作。

var RNFS = require("react-native-fs");

一旦你这样做了,你就不应该再这样做了。相同的代码可以重复。