### Basic Usage of FileViewer Component Source: https://github.com/plangrid/react-file-viewer/blob/master/README.md Demonstrates how to use the FileViewer component with basic props like fileType and filePath. It also shows how to provide custom error handling and a custom error component. ```javascript // MyApp.js import React, { Component } from 'react'; import logger from 'logging-library'; import FileViewer from 'react-file-viewer'; import { CustomErrorComponent } from 'custom-error'; const file = 'http://example.com/image.png' const type = 'png' class MyComponent extends Component { render() { return ( ); } onError(e) { logger.logError(e, 'error in file-viewer'); } } ``` -------------------------------- ### Adding Support for RTF File Type Source: https://github.com/plangrid/react-file-viewer/blob/master/README.md Illustrates the process of extending the react-file-viewer to support new file types, specifically .rtf files, by creating a driver component and updating the getDriver method. ```javascript case 'rtf': return RtfViewer; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.