Skip to content

Commit

Permalink
docs: useTheme add localStorageKey
Browse files Browse the repository at this point in the history
  • Loading branch information
ianzone committed Aug 5, 2024
1 parent a596ab7 commit e9394f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/hooks/src/useTheme/demo/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { useTheme } from 'ahooks';
import React from 'react';

export default () => {
const { theme, themeMode, setThemeMode } = useTheme();
const { theme, themeMode, setThemeMode } = useTheme({
localStorageKey: 'themeMode',
});

return (
<>
Expand Down
4 changes: 3 additions & 1 deletion packages/hooks/src/useTheme/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ This hook is used to get and set the theme, and store the themeMode into localSt
## API

```typescript
const { theme, themeMode, setThemeMode } = useTheme();
const { theme, themeMode, setThemeMode } = useTheme({
localStorageKey?: string;
});
```

### Result
Expand Down
4 changes: 3 additions & 1 deletion packages/hooks/src/useTheme/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ nav:
## API

```typescript
const { theme, themeMode, setThemeMode } = useTheme();
const { theme, themeMode, setThemeMode } = useTheme({
localStorageKey?: string;
});
```

### 返回值
Expand Down

0 comments on commit e9394f2

Please sign in to comment.