cyntler / cyntler/react-doc-viewer

NoRendererComponent is not applying and causing flashing

Open
#204 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
481
Forks
147
PR merge metrics
No merged PRs in 30d

Description

As title mentioned, my custom norenderer component wasn't applied and causing the viewer to flash and force to stay at the initialActiceDocument, even I press next or pervious it will went back to the initialActiveDocument.

```
import { IDocumentViewerProps } from "@/Global";
import {
Drawer,
DrawerBody,
DrawerCloseButton,
DrawerContent,
DrawerHeader,
DrawerOverlay,
Text
} from "@chakra-ui/react";
import DocViewer, { DocViewerRenderers, IDocument } from "@cyntler/react-doc-viewer";
import { ComponentType, FC } from "react";

interface NoRenderComponentProps {
document?: IDocument;
fileName: string;
}

const NoRenderComponent: FC = ({ document, fileName }) => {
return (
No renderer available for file {fileName}.
);
};

const DocumentViewerDrawer = (props: IDocumentViewerProps) => {
const {
isOpen,
onClose,
docId,
documents
} = props;

return (





{documents && docId &&

}



)
}

export default DocumentViewerDrawer;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.