We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9045feb commit 2bc3a7bCopy full SHA for 2bc3a7b
playground/app.tsx
@@ -102,7 +102,6 @@ export const App = (): JSX.Element => {
102
createEffect(() => {
103
const action = dark() ? 'add' : 'remove';
104
document.body.classList[action]('dark');
105
- localStorage.setItem('dark', String(dark()));
106
});
107
108
const header = !noHeader;
@@ -137,7 +136,11 @@ export const App = (): JSX.Element => {
137
136
children={
138
<Header
139
dark={dark()}
140
- toggleDark={() => setDark(!dark())}
+ toggleDark={() => {
+ const toggledValue = !dark();
141
+ setDark(toggledValue);
142
+ localStorage.setItem('dark', String(toggledValue));
143
+ }}
144
isHorizontal={isHorizontal}
145
tabs={tabs()}
146
setTabs={setTabs}
0 commit comments