react-file-viewer
react-file-viewer copied to clipboard
RTF support
How i can, show the rtf file, i did't get how to extend the rtf and how to show the rtf file.
Are you able to import and use the component for PDF, Image and Doc preview with in React application. I am facing problem importing the package, would appreciate your help.
Are you able to import and use the component for PDF, Image and Doc preview with in React application. I am facing problem importing the package, would appreciate your help.
I tried this for pdf and this is working fine for me
import FileViewer from 'react-file-viewer';
import { CustomErrorComponent } from 'custom-error';
const file = 'pdf_url'
const type = 'pdf'
class App extends Component {
onError(e) {
logger.logError(e, 'error in file-viewer');
}
render() {
return (
<FileViewer
fileType={type}
filePath={file}
errorComponent={CustomErrorComponent}
onError={this.onError}/>
);
}
}
I used create react app, to create my project its giving me memory heap error. I am not understanding if problem is with virsion of file viewer or if i missed to add any dependencies . Can you send the dependencies that you have in package.json. just to check if i have missed any dependency.
I used create react app, to create my project its giving me memory heap error. I am not understanding if problem is with virsion of file viewer or if i missed to add any dependencies . Can you send the dependencies that you have in package.json. just to check if i have missed any dependency.
Thank you for your input, it still didn't work for me. The moment i import react-file-viewer compiler is throwing error for me.
@mparupat change the import to this import FileViewer from "react-file-viewer";