diff --git a/.changeset/tall-doors-ring.md b/.changeset/tall-doors-ring.md new file mode 100644 index 000000000000..668cd45064c5 --- /dev/null +++ b/.changeset/tall-doors-ring.md @@ -0,0 +1,7 @@ +--- +"@refinedev/devtools-internal": patch +--- + +fix(devtools-internal): broken env conditional in useQuerySubscription hook + +When using Refine with React Native, `process.env.NODE_ENV !== "development" ? () => ({}) : () => {...}` conditional in `useQuerySubscription` hook was causing a syntax error. This PR fixes the issue by explicitly returning an empty object on non-development environments. diff --git a/packages/devtools-internal/src/use-query-subscription.tsx b/packages/devtools-internal/src/use-query-subscription.tsx index 183e4f2a4e4a..a79908551d53 100644 --- a/packages/devtools-internal/src/use-query-subscription.tsx +++ b/packages/devtools-internal/src/use-query-subscription.tsx @@ -9,7 +9,9 @@ import { createQueryListener, createMutationListener } from "./listeners"; export const useQuerySubscription = __DEV_CONDITION__ !== "development" - ? () => ({}) + ? () => { + return {}; + } : (queryClient: QueryClient) => { const { ws } = useContext(DevToolsContext); const queryCacheSubscription = React.useRef<() => void>();