Skip to content

Commit

Permalink
fix(build): revert #456 a workaround for ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Jun 2, 2022
1 parent 101ae95 commit e0a36c4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ import {
createProxy as createProxyToCompare,
isChanged,
} from 'proxy-compare'
// import { useSyncExternalStore } from 'use-sync-external-store/shim'
// This doesn't work in ESM, because use-sync-external-store only exposes CJS.
// See: https://github.com/pmndrs/valtio/issues/452
// The following is a workaround until ESM is supported.
import useSyncExternalStoreExports from 'use-sync-external-store/shim'
import { useSyncExternalStore } from 'use-sync-external-store/shim'
import { snapshot, subscribe } from './vanilla'

const { useSyncExternalStore } = useSyncExternalStoreExports

// Unfortunately, this doesn't work with tsc.
// Hope to find a solution to make this work.
//
Expand Down

0 comments on commit e0a36c4

Please sign in to comment.