vinzscam/react-native-file-viewer

Module RNFileViewer method 'open' got 5 arguments, expected 4 error on UWP

nikjohns opened this issue · 2 comments

capture

I am developing application for windows platform using react native and while using this lib, i am facing this issue.

React-native: 0.57

import React, { Component } from 'react'; import { AppRegistry, Text, View, Image, Button, Alert } from 'react-native'; import FileViewer from 'react-native-file-viewer'; import RNFS from 'react-native-fs'; var path = RNFS.DocumentDirectoryPath + '/test.txt'; componentDidMount() { FileViewer.open(path) } render() { return ( <View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}> <Text>Demo</Text> </View> ) } }
and if i use this in ComponentDidMount, then it returns file content
If i use this, it shows content of test.txt file sucessfully
RNFS.readFile(path, 'utf8') .then((success) => { Alert.alert('FILE WRITTEN!' + success); }) .catch((err) => { Alert.alert(err.message); });
what is the problem?

I'm having the same problem.
Following.

Hi,
there was a problem with windows platform. It should be fixed now (version 1.0.14).