Skip to content

Commit

Permalink
chore: Remove React.FC from docs examples (#9669)
Browse files Browse the repository at this point in the history
Co-authored-by: Banks Nussman <[email protected]>
  • Loading branch information
bnussman-akamai and bnussman authored Sep 13, 2023
1 parent 20c389d commit e5ec3e3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/development-guide/05-fetching-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import * as React from 'react';
import { getProfile } from '@linode/api-v4/lib/profile';
// ... other imports

const UsernameDisplay: React.FC<> = () => {
const UsernameDisplay = () => {
const [loading, setLoading] = React.useState(false);
const [error, setError] = React.useState<APIError | null>(null);
const [profile, setProfile] = React.useState<Profile | null>(null);
Expand Down Expand Up @@ -114,7 +114,7 @@ Loading and error states are managed by React Query. The earlier username displa
import * as React from "react";
import { useProfile } from "src/queries/profile";

const UsernameDisplay: React.FC<> = () => {
const UsernameDisplay = () => {
const { loading, error, data: profile } = useProfile();

if (loading) {
Expand Down Expand Up @@ -157,7 +157,7 @@ import profileContainer, {
Props as ProfileProps,
} from "src/containers/profile.container";

const UsernameDisplay: React.FC<ProfileProps> = (props) => {
const UsernameDisplay = (props: ProfileProps) => {
const { requestProfile, profileLoading, profileError, profileData } = props;

React.useEffect(() => requestProfile, []);
Expand Down
4 changes: 2 additions & 2 deletions docs/development-guide/06-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Props {
linode: Linode;
}

const LinodeLabelDisplay: React.FC<Props> = (props) => {
const LinodeLabelDisplay = (props: Props) => {
return <span>{props.linode.label}</span>;
};

Expand All @@ -20,7 +20,7 @@ interface Props {
label: string;
}

const LinodeLabelDisplay: React.FC<Props> = (props) => {
const LinodeLabelDisplay = (props: Props) => {
return <span>{props.label}</span>;
};

Expand Down
2 changes: 1 addition & 1 deletion docs/development-guide/11-feature-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ To consume a feature flag from a function component, use the `useFlags` hook:
import * as React from "react";
import { useFlags } from "src/hooks/useFlags";

const ImagesPricingBanner: React.FC<> = () => {
const ImagesPricingBanner = () => {
const flags = useFlags();

if (flags.imagesPricingBanner) {
Expand Down
2 changes: 1 addition & 1 deletion packages/api-v4/REACT.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { getLinodes, Linode } from '@linode/api-v4/lib/linodes'
import { APIError, ResourcePage } from '@linode/api-v4/lib/types';
import React from 'react'

const MyComponent: React.FC<{}> = () => {
const MyComponent = () => {
const [linodes, setLinodesData] = React.useState<Linode[] | undefined>(undefined);
const [errors, setErrors] = React.useState<APIError[] | undefined>(undefined);
const [loading, setLoading] = React.useState<boolean>(false);
Expand Down

0 comments on commit e5ec3e3

Please sign in to comment.