Skip to content

Commit

Permalink
revert: react use hook
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Oct 30, 2023
1 parent e82f2e7 commit 9e38416
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/strong-stingrays-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zag-js/react": patch
---

Revert issue with react export for the `use` hook
5 changes: 4 additions & 1 deletion packages/frameworks/react/src/use-snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

import { snapshot, subscribe, type Snapshot } from "@zag-js/store"
import { createProxy as createProxyToCompare, isChanged } from "proxy-compare"
import { useCallback, useEffect, useMemo, useRef, useSyncExternalStore, use } from "react"
import ReactExport, { useCallback, useEffect, useMemo, useRef, useSyncExternalStore } from "react"

interface Options {
sync?: boolean
}

//@ts-ignore
const { use } = ReactExport

const targetCache = new WeakMap()

export function useSnapshot<T extends object>(proxyObject: T, options?: Options): Snapshot<T> {
Expand Down

4 comments on commit 9e38416

@vercel
Copy link

@vercel vercel bot commented on 9e38416 Oct 30, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

zag-vue – ./examples/vue-ts

zag-vue-git-main-chakra-ui.vercel.app
zag-vue.vercel.app
zag-vue-chakra-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 9e38416 Oct 30, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 9e38416 Oct 30, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

zag-nextjs – ./examples/next-ts

zag-nextjs-git-main-chakra-ui.vercel.app
zag-nextjs-chakra-ui.vercel.app
zag-two.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 9e38416 Oct 30, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

zag-solid – ./examples/solid-ts

zag-solid-chakra-ui.vercel.app
zag-solid.vercel.app
zag-solid-git-main-chakra-ui.vercel.app

Please sign in to comment.