diff --git a/.env.example b/.env.example index daa84046e..303263a99 100644 --- a/.env.example +++ b/.env.example @@ -3,5 +3,8 @@ # Google Maps API key (enables address search) # NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_api_key +# React render debugging overlay (disabled by default) +# NEXT_PUBLIC_REACT_SCAN=false + # Dev server port (default: 3000) # PORT=3000 diff --git a/apps/editor/app/client-bootstrap.tsx b/apps/editor/app/client-bootstrap.tsx index 610eac4e6..892856d9d 100644 --- a/apps/editor/app/client-bootstrap.tsx +++ b/apps/editor/app/client-bootstrap.tsx @@ -11,9 +11,12 @@ import '../lib/bootstrap' import { type ReactNode, useEffect } from 'react' +const shouldEnableReactScan = + process.env.NODE_ENV === 'development' && process.env.NEXT_PUBLIC_REACT_SCAN === 'true' + export function ClientBootstrap({ children }: { children: ReactNode }) { useEffect(() => { - if (process.env.NODE_ENV !== 'development') return + if (!shouldEnableReactScan) return // Loaded here (not via a `