File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,22 @@ sidebar_label: Examples
77- [ Create React App TypeScript Todo Example 2021] ( https://github.com/laststance/create-react-app-typescript-todo-example-2021 )
88- [ Ben Awad's 14 hour Fullstack React/GraphQL/TypeScript Tutorial] ( https://www.youtube.com/watch?v=I6ypD7qv3Z8 )
99- [ Cypress Realworld App] ( https://github.com/cypress-io/cypress-realworld-app )
10+
11+ ---
12+
13+ ### 🧠 Tip: Using TypeScript with React.FC
14+
15+ When defining a functional component with TypeScript, you can explicitly use the ` React.FC ` type for better prop validation and IntelliSense.
16+
17+ ``` tsx
18+ import React from " react" ;
19+
20+ type Props = {
21+ message: string ;
22+ };
23+
24+ const Hello: React .FC <Props > = ({ message }) => {
25+ return <h1 >{ message } </h1 >;
26+ };
27+
28+ export default Hello ;
You can’t perform that action at this time.
0 commit comments