We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 911f928 commit 42653ccCopy full SHA for 42653cc
1 file changed
docs/basic/examples.md
@@ -7,3 +7,22 @@ sidebar_label: Examples
7
- [Create React App TypeScript Todo Example 2021](https://github.com/laststance/create-react-app-typescript-todo-example-2021)
8
- [Ben Awad's 14 hour Fullstack React/GraphQL/TypeScript Tutorial](https://www.youtube.com/watch?v=I6ypD7qv3Z8)
9
- [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;
0 commit comments