Skip to content

Commit 1b68fee

Browse files
committed
Remove explicit React.FC type declaration
1 parent 153a88c commit 1b68fee

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

packages/react-pdf/src/Outline.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export type OutlineProps = {
6464
*
6565
* Should be placed inside `<Document />`. Alternatively, it can have `pdf` prop passed, which can be obtained from `<Document />`'s `onLoadSuccess` callback function.
6666
*/
67-
const Outline: React.FC<OutlineProps> = function Outline(props) {
67+
export default function Outline(props: OutlineProps) {
6868
const documentContext = useDocumentContext();
6969

7070
const mergedProps = { ...documentContext, ...props };
@@ -200,6 +200,4 @@ const Outline: React.FC<OutlineProps> = function Outline(props) {
200200
<OutlineContext.Provider value={childContext}>{renderOutline()}</OutlineContext.Provider>
201201
</div>
202202
);
203-
};
204-
205-
export default Outline;
203+
}

packages/react-pdf/src/Page.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ export type PageProps = {
303303
*
304304
* 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.
305305
*/
306-
const Page: React.FC<PageProps> = function Page(props) {
306+
export default function Page(props: PageProps) {
307307
const documentContext = useDocumentContext();
308308

309309
const mergedProps = { ...documentContext, ...props };
@@ -644,6 +644,4 @@ const Page: React.FC<PageProps> = function Page(props) {
644644
{renderContent()}
645645
</div>
646646
);
647-
};
648-
649-
export default Page;
647+
}

packages/react-pdf/src/Thumbnail.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export type ThumbnailProps = Omit<
4848
*
4949
* Should be placed inside `<Document />`. Alternatively, it can have `pdf` prop passed, which can be obtained from `<Document />`'s `onLoadSuccess` callback function.
5050
*/
51-
const Thumbnail: React.FC<ThumbnailProps> = function Thumbnail(props) {
51+
export default function Thumbnail(props: ThumbnailProps) {
5252
const documentContext = useDocumentContext();
5353

5454
const mergedProps = { ...documentContext, ...props };
@@ -111,6 +111,4 @@ const Thumbnail: React.FC<ThumbnailProps> = function Thumbnail(props) {
111111
/>
112112
</a>
113113
);
114-
};
115-
116-
export default Thumbnail;
114+
}

0 commit comments

Comments
 (0)