Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/solid-router/src/Asset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function Script({

if (!router.isServer) {
// render an empty script on the client just to avoid hydration errors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Update the comment to match the new behavior.

The comment states "render an empty script on the client just to avoid hydration errors", but the code now returns null instead of an empty script tag.

Apply this diff to update the comment:

-    // render an empty script on the client just to avoid hydration errors
+    // render nothing on the client to match server-side behavior and avoid hydration errors
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// render an empty script on the client just to avoid hydration errors
// render nothing on the client to match server-side behavior and avoid hydration errors
🤖 Prompt for AI Agents
In packages/solid-router/src/Asset.tsx around line 127, update the inline
comment which currently reads "render an empty script on the client just to
avoid hydration errors" to reflect the new behavior: the component now returns
null on the client to avoid hydration errors; change the comment to something
like "return null on the client to avoid hydration errors" so it matches the
code.

return <script />
return null
}

if (attrs?.src && typeof attrs.src === 'string') {
Expand Down
Loading