Skip to content

Commit 0674dcd

Browse files
committed
frontend: react-query: enable devtools according to environment
Signed-off-by: warjiang <[email protected]>
1 parent 7fd0708 commit 0674dcd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/src/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ const queryClient = new QueryClient({
3939
},
4040
},
4141
});
42-
const queryDevtoolsEnabled = false;
42+
43+
// https://vite.dev/guide/env-and-mode
44+
// if you want to enable the devtools for react-query,
45+
// just set REACT_APP_ENABLE_REACT_QUERY_DEVTOOLS=true in .env file
46+
const queryDevtoolsEnabled = import.meta.env.REACT_APP_ENABLE_REACT_QUERY_DEVTOOLS === 'true';
4347

4448
function App() {
4549
return (

0 commit comments

Comments
 (0)