Skip to content

Commit

Permalink
[fix] useSearchParams Suspense 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
euije committed Mar 15, 2024
1 parent 27f5fbe commit 368fcb7
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions app/event/university/Booth/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@ import {
} from '@/util/string';
import { sendGTMEvent } from '@next/third-parties/google';
import { useSearchParams } from 'next/navigation';
import React, { useEffect } from 'react';
import React, { Suspense, useEffect } from 'react';
import { isAndroid, isIOS } from 'react-device-detect';

export default function Page() {
return (
<>
<div>{'redirecting...'}</div>
<Suspense>
<GTMComponent />
</Suspense>
</>
);
}

const GTMComponent = () => {
const params = useSearchParams();

useEffect(() => {
Expand All @@ -34,9 +45,5 @@ export default function Page() {
}
}, [params]);

return (
<>
<div>{'redirecting...'}</div>
</>
);
}
return <div>{'data sending..'}</div>;
};

0 comments on commit 368fcb7

Please sign in to comment.