From 510b6535cef397b253be9cf855a7bda8da44ff0e Mon Sep 17 00:00:00 2001 From: mkosir Date: Tue, 17 Dec 2024 10:56:41 +0100 Subject: [PATCH] update docusaurus --- website/src/pages/index.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/src/pages/index.mdx b/website/src/pages/index.mdx index 6a50cf6..2b7bf04 100644 --- a/website/src/pages/index.mdx +++ b/website/src/pages/index.mdx @@ -75,14 +75,14 @@ Being expressive and keeping types as **narrow as possible** offers several bene ### Type Inference -As a rule of thumb, explicitly declare types when it helps to narrow them. +As a rule of thumb, explicitly declare types only when it helps to narrow them. Just because you don't need to add types doesn't mean you shouldn't. In some cases, explicitly declaring types can improve code readability and clarify intent. -Explicitly declare types when it helps to narrow them: +Explicitly declare types when doing so helps to narrow them: ```ts // ❌ Avoid @@ -98,7 +98,7 @@ type UserRole = 'admin' | 'guest'; const [userRole, setUserRole] = useState('admin'); // Explicit type 'UserRole' ``` -Don't explicitly declare types when they can be inferred: +Avoid explicitly declaring types when they can be inferred: ```ts // ❌ Avoid