fix: Change deprecated React.VFC to React.FC

The type `VFC` (VoidFunctionComponent) is deprecated and is equivalent
to `FC` (FunctionalComponent).

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L531

This commit updates the generated files from an installation to use the
non-deprecated React type.
This commit is contained in:
Ethan Mick 2023-01-13 13:12:51 -05:00
parent d18331ff33
commit 6d29300a5e
No known key found for this signature in database
GPG Key ID: 323933F8DE4DFBD6
4 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ type User = {
name: string;
};
export const Page: React.VFC = () => {
export const Page: React.FC = () => {
const [user, setUser] = React.useState<User>();
return (

View File

@ -7,7 +7,7 @@ type User = {
name: string;
};
export const Page: React.VFC = () => {
export const Page: React.FC = () => {
const [user, setUser] = React.useState<User>();
return (

View File

@ -7,7 +7,7 @@ type User = {
name: string;
};
export const Page: React.VFC = () => {
export const Page: React.FC = () => {
const [user, setUser] = React.useState<User>();
return (

View File

@ -1,7 +1,7 @@
```ts
// CustomDocumentationComponent.ts|tsx
export const CustomDocumentationComponent: React.VFC = () => {
export const CustomDocumentationComponent: React.FC = () => {
return (
<div>
<h1>Replacing DocsPage with a custom component</h1>