Skip to content

Commit

Permalink
update docusaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
mkosir committed Dec 10, 2023
1 parent 57f7868 commit 5f9cf9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const userRole: string = 'admin'; // Type 'string'
const employees = new Map<string, number>([['gabriel', 32]]);
const [isActive, setIsActive] = useState<boolean>(false);

// ✅ Use
// ✅ Use type inference
const USER_ROLE = 'admin'; // Type 'admin'
const employees = new Map([['gabriel', 32]]); // Type 'Map<string, number>'
const [isActive, setIsActive] = useState(false); // Type 'boolean'
Expand All @@ -89,7 +89,7 @@ employees.set('lea', 'foo-anything');
type UserRole = 'admin' | 'guest';
const [userRole, setUserRole] = useState('admin'); // Type 'string'

// ✅ Use
// ✅ Use explicit type declaration to narrow the type
const employees = new Map<string, number>(); // Type 'Map<string, number>'
employees.set('gabriel', 32);
type UserRole = 'admin' | 'guest';
Expand Down

0 comments on commit 5f9cf9b

Please sign in to comment.