Files
twenty/packages/twenty-front/src/modules/debug/components/ApolloDevLogEffect.tsx
T
Charles BochetandGitHub 86c0f311f5 Introduce ComponentState (#4386)
* Proof of concept ComponentState

* Migrate to createState and createFamilyState

* Refactor

* Fix

* Fix tests

* Fix lint

* Fix tests

* Re-enable coverage
2024-03-09 11:31:00 +01:00

19 lines
469 B
TypeScript

import { useEffect } from 'react';
import { loadDevMessages, loadErrorMessages } from '@apollo/client/dev';
import { useRecoilValue } from 'recoil';
import { isDebugModeState } from '@/client-config/states/isDebugModeState';
export const ApolloDevLogEffect = () => {
const isDebugMode = useRecoilValue(isDebugModeState());
useEffect(() => {
if (isDebugMode) {
loadDevMessages();
loadErrorMessages();
}
}, [isDebugMode]);
return null;
};