Skip to content

Commit

Permalink
revert to jsx pragma in examples/07
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Feb 25, 2023
1 parent c561bad commit d178820
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions examples/07_atomsignal/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import jsxRuntime from 'react/jsx-runtime';
import jsxDevRuntime from 'react/jsx-dev-runtime';
/** @jsxImportSource jotai-signal */

import { useSetAtom } from 'jotai/react';
import { atomSignal } from 'jotai-signal';
import { jsx, jsxs } from 'jotai-signal/jsx-runtime';

// This hack only works if jsxRuntime is CJS not ESM.
(jsxRuntime as any).jsx = jsx;
(jsxRuntime as any).jsxs = jsxs;
(jsxDevRuntime as any).jsx = jsx;
(jsxDevRuntime as any).jsxs = jsxs;

const count = atomSignal(0);
const doubled = atomSignal((get) => get(count) * 2);
Expand Down

0 comments on commit d178820

Please sign in to comment.