Skip to content

Commit

Permalink
Apply changesets and update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Jun 23, 2024
1 parent d176afa commit e38dc23
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ interface UseThemeYield {
### Next.js App Router

```tsx
import { ForceTheme } from "nextjs-themes";
import { ForceTheme } from "nextjs-themes/force-theme";

function MyPage() {
return (
Expand All @@ -234,6 +234,8 @@ function MyPage() {
export default MyPage;
```

> If you are using TypeScript and have not set nodeResolution to `Bundler` or `Node16` or `NodeNext`, you need to import from `nextjs-themes/client/force-theme`
### Next.js Pages Router

For the pages router, you have two options. The first option is the same as the app router, and the second option, which is compatible with `next-themes`, involves adding the `theme` property to your page component like this:
Expand Down Expand Up @@ -348,6 +350,8 @@ const background = getBackground(resolvedTheme);

Without `resolvedTheme`, you would only know the theme is "system", not what it resolved to.

![Repo stats](https://repobeats.axiom.co/api/embed/3cc219825aee3c38bad8829fb9da0dd6301a1867.svg "Repobeats analytics image")

## License

This library is licensed under the MPL-2.0 open-source license.
Expand Down

0 comments on commit e38dc23

Please sign in to comment.