chore(dev): install and wire react-grab
react-grab lets you point at any DOM element on the page and press Cmd+C to copy the file name, React component, and HTML source — then paste straight into a coding agent (Claude Code, Cursor, etc.) for much higher-fidelity context. Wiring (auto-detected by `npx grab@latest init --force`): a Next <Script> tag in src/app/layout.tsx that loads the bundle from unpkg in development only. Production builds skip the script entirely so no extra weight ships to end users. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { Metadata, Viewport } from 'next';
|
||||
import Script from 'next/script';
|
||||
import { headers } from 'next/headers';
|
||||
import { Inter, JetBrains_Mono } from 'next/font/google';
|
||||
import { Toaster } from 'sonner';
|
||||
@@ -50,6 +51,15 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<head>
|
||||
{process.env.NODE_ENV === 'development' && (
|
||||
<Script
|
||||
src="//unpkg.com/react-grab/dist/index.global.js"
|
||||
crossOrigin="anonymous"
|
||||
strategy="beforeInteractive"
|
||||
/>
|
||||
)}
|
||||
</head>
|
||||
<body
|
||||
data-form-factor={formFactor}
|
||||
className={`${inter.variable} ${jetbrainsMono.variable} font-sans antialiased`}
|
||||
|
||||
Reference in New Issue
Block a user