Skip to content

Commit

Permalink
fix: fallback Zustand for ESM (#1551)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Jun 30, 2023
1 parent 1dfc307 commit 7b4c664
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/useProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import zustand from 'zustand'

// TODO: upgrade to v4
// https://github.com/pmndrs/drei/pull/1550
const create = (zustand as any).default as typeof zustand
const create = ((zustand as any).default || zustand) as typeof zustand

type Data = {
errors: string[]
Expand Down
2 changes: 1 addition & 1 deletion src/web/KeyboardControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { subscribeWithSelector } from 'zustand/middleware'

// TODO: upgrade to v4
// https://github.com/pmndrs/drei/pull/1550
const create = (zustand as any).default as typeof zustand
const create = ((zustand as any).default || zustand) as typeof zustand

// These are removed in Zustand v4
type State = object // unknown
Expand Down
2 changes: 1 addition & 1 deletion src/web/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import zustand from 'zustand/shallow'

// TODO: upgrade to v4
// https://github.com/pmndrs/drei/pull/1550
const shallow = (zustand as any).default as typeof zustand
const shallow = ((zustand as any).default || zustand) as typeof zustand

const context = React.createContext<THREE.Object3D[]>([])

Expand Down

1 comment on commit 7b4c664

@vercel
Copy link

@vercel vercel bot commented on 7b4c664 Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.