Pattern: Missing script id
Issue: -
Next.js requires inline scripts to have an id attribute for proper hydration. Without an id, inline scripts may not execute correctly during server-side rendering and client-side hydration.
Example of incorrect code:
<script dangerouslySetInnerHTML={{ __html: `console.log('hello')` }} />
Example of correct code:
<script
id="my-script"
dangerouslySetInnerHTML={{ __html: `console.log('hello')` }}
/>