We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 40f406a + ee08d23 commit 3fe8cc3Copy full SHA for 3fe8cc3
src/mocks/mswClientProvider.ts
@@ -21,5 +21,6 @@ export default function MSWClientProvider({ children }: { children: React.ReactN
21
22
/** app/layout.tsx는 Next.js에서 서버에서 렌더링될 수도 있기 때문에, window가 없어서 MSW가 setupWorker()에서 터지는 경우가 있습니다. */
23
/** 그래서 MSW가 실행될 준비가 된 다음에만 children을 렌더링하도록 하여 자식 컴포넌트에서 fetch 요청을 했을때 404가 뜨지 않도록 보장하였습니다. */
24
- return readyToUseMSW ? children : null;
+ const shouldRender = readyToUseMSW || process.env.NODE_ENV === 'production';
25
+ return shouldRender ? children : null;
26
}
0 commit comments