Skip to content

Commit

Permalink
update docusaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
mkosir committed Dec 17, 2024
1 parent cf60c16 commit 510b653
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<Note>
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.
</Note>

Explicitly declare types when it helps to narrow them:
Explicitly declare types when doing so helps to narrow them:

```ts
// ❌ Avoid
Expand All @@ -98,7 +98,7 @@ type UserRole = 'admin' | 'guest';
const [userRole, setUserRole] = useState<UserRole>('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
Expand Down

0 comments on commit 510b653

Please sign in to comment.