File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,20 @@ wraps everything in the `DarkMode` fixture.
4747You can do that by adding a file named ` cosmos.decorator.tsx ` to your root ` src `
4848folder that looks something like this:
4949
50+ ### React
51+
52+ ``` ts
53+ // "use client" if you're using Next.js
54+ import * as React from ' react' ;
55+ import { DarkMode } from ' react-cosmos-dark-mode/DarkMode' ;
56+
57+ export default function GlobalDecorator(props : { children: React .ReactNode }) {
58+ return <DarkMode {... props } />;
59+ }
60+ ```
61+
62+ ### Preact
63+
5064``` ts
5165import type { RenderableProps } from ' preact' ;
5266import { DarkMode } from ' react-cosmos-dark-mode/DarkMode' ;
@@ -60,8 +74,6 @@ export default function GlobalDecorator({
6074}
6175```
6276
63- (Can someone please help me update this for React?)
64-
6577## Configuration
6678
6779The following configuration options can be set in the ` ui.darkMode ` section of
You can’t perform that action at this time.
0 commit comments