Skip to content

Commit

Permalink
Remove explicit React.FC type declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Apr 26, 2024
1 parent d57f5e6 commit 54be407
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions packages/react-pdf/src/Outline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export type OutlineProps = {
*
* Should be placed inside `<Document />`. Alternatively, it can have `pdf` prop passed, which can be obtained from `<Document />`'s `onLoadSuccess` callback function.
*/
const Outline: React.FC<OutlineProps> = function Outline(props) {
export default function Outline(props: OutlineProps) {
const documentContext = useDocumentContext();

const mergedProps = { ...documentContext, ...props };
Expand Down Expand Up @@ -200,6 +200,4 @@ const Outline: React.FC<OutlineProps> = function Outline(props) {
<OutlineContext.Provider value={childContext}>{renderOutline()}</OutlineContext.Provider>
</div>
);
};

export default Outline;
}
6 changes: 2 additions & 4 deletions packages/react-pdf/src/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export type PageProps = {
*
* Should be placed inside `<Document />`. Alternatively, it can have `pdf` prop passed, which can be obtained from `<Document />`'s `onLoadSuccess` callback function, however some advanced functions like linking between pages inside a document may not be working correctly.
*/
const Page: React.FC<PageProps> = function Page(props) {
export default function Page(props: PageProps) {
const documentContext = useDocumentContext();

const mergedProps = { ...documentContext, ...props };
Expand Down Expand Up @@ -644,6 +644,4 @@ const Page: React.FC<PageProps> = function Page(props) {
{renderContent()}
</div>
);
};

export default Page;
}
6 changes: 2 additions & 4 deletions packages/react-pdf/src/Thumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export type ThumbnailProps = Omit<
*
* Should be placed inside `<Document />`. Alternatively, it can have `pdf` prop passed, which can be obtained from `<Document />`'s `onLoadSuccess` callback function.
*/
const Thumbnail: React.FC<ThumbnailProps> = function Thumbnail(props) {
export default function Thumbnail(props: ThumbnailProps) {
const documentContext = useDocumentContext();

const mergedProps = { ...documentContext, ...props };
Expand Down Expand Up @@ -111,6 +111,4 @@ const Thumbnail: React.FC<ThumbnailProps> = function Thumbnail(props) {
/>
</a>
);
};

export default Thumbnail;
}

0 comments on commit 54be407

Please sign in to comment.