Skip to content

Commit 4726fea

Browse files
authored
fix: Remove unnecessary error logs (#78)
1 parent 559aa8d commit 4726fea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/browser/src/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
'use client';
12
import { createUseFunnel } from '@use-funnel/core';
23
import { useEffect, useMemo, useState } from 'react';
34

45
export * from '@use-funnel/core';
56

67
export const useFunnel = createUseFunnel(({ id, initialState }) => {
78
const [location, setLocation] = useState(() => ({
8-
search: window.location.search,
9+
search: typeof window !== 'undefined' ? window.location.search : '',
910
}));
1011
const [state, setState] = useState(() => ({
11-
...window.history.state,
12+
...(typeof window !== 'undefined' ? window.history.state : {}),
1213
}));
1314

1415
useEffect(() => {

0 commit comments

Comments
 (0)