Lesson 28 of 56
TypescriptReact Props & State Typing
20 minutes
Course progress50%
Props Interface
interface CardProps {
title: string;
description?: string;
}
const Card: React.FC<CardProps> = (
);
Lesson 28 of 56
Typescript20 minutes
interface CardProps {
title: string;
description?: string;
}
const Card: React.FC<CardProps> = (
);
type Status = "idle" | "loading" | "error";
const [status, setStatus] = useState<Status>("idle");
interface ThemeContextProps { dark: boolean; toggle(): void; }
const ThemeContext = React.createContext<ThemeContextProps | undefined>(undefined);