From 42653cc025ed0588b88a98a8dfe3a8a82eb09633 Mon Sep 17 00:00:00 2001 From: Madhu <2400030376@kluniversity.in> Date: Tue, 4 Nov 2025 00:55:08 +0530 Subject: [PATCH 1/2] docs: add React.FC TypeScript example to examples.md --- docs/basic/examples.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/basic/examples.md b/docs/basic/examples.md index 8b2bd52c..a7ed2807 100644 --- a/docs/basic/examples.md +++ b/docs/basic/examples.md @@ -7,3 +7,22 @@ sidebar_label: Examples - [Create React App TypeScript Todo Example 2021](https://github.com/laststance/create-react-app-typescript-todo-example-2021) - [Ben Awad's 14 hour Fullstack React/GraphQL/TypeScript Tutorial](https://www.youtube.com/watch?v=I6ypD7qv3Z8) - [Cypress Realworld App](https://github.com/cypress-io/cypress-realworld-app) + +--- + +### 🧠 Tip: Using TypeScript with React.FC + +When defining a functional component with TypeScript, you can explicitly use the `React.FC` type for better prop validation and IntelliSense. + +```tsx +import React from "react"; + +type Props = { + message: string; +}; + +const Hello: React.FC = ({ message }) => { + return

{message}

; +}; + +export default Hello; From caf052c006857adc7df4f38f5b9070a412465a0c Mon Sep 17 00:00:00 2001 From: Madhu <2400030376@kluniversity.in> Date: Tue, 4 Nov 2025 18:44:14 +0530 Subject: [PATCH 2/2] chore: format examples.md with Prettier --- docs/basic/examples.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/basic/examples.md b/docs/basic/examples.md index a7ed2807..49b261cf 100644 --- a/docs/basic/examples.md +++ b/docs/basic/examples.md @@ -26,3 +26,4 @@ const Hello: React.FC = ({ message }) => { }; export default Hello; +```