React-native 读取md 文件

作者: ziqiDev | 来源:发表于2018-09-19 16:58 被阅读3次

put your file in assets folder and then fetch using react-native-fetch-blob package

RNFetchBlob.fs.readStream(RNFetchBlob.fs.asset('test.md'), 'utf8')

.then((stream) => {

  let data = '';

  stream.open();

  stream.onData((chunk) => {

    data += chunk;

  });

  stream.onEnd(() => {

    this.setState({

      data,

    });

  });

});

相关文章

网友评论

    本文标题:React-native 读取md 文件

    本文链接:https://www.haomeiwen.com/subject/ehginftx.html