Skip to content

Commit

Permalink
fix: better _TSR_ check
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Dec 11, 2024
1 parent 7bafba1 commit 8306ea9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-router/src/ScriptOnce.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function ScriptOnce({
? `console.info(\`Injected From Server:
${jsesc(children.toString(), { quotes: 'backtick' })}\`)`
: '',
'if (__TSR__) __TSR__.cleanScripts()',
'if (typeof __TSR__ !== "undefined") __TSR__.cleanScripts()',
]
.filter(Boolean)
.join('\n'),
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3041,7 +3041,7 @@ export class Router<
? `; console.info(\`Injected From Server:
${script}\`)`
: ''
}; if (__TSR__) __TSR__.cleanScripts()</script>`,
}; if (typeof __TSR__ !== 'undefined') __TSR__.cleanScripts()</script>`,
)
}

Expand Down

0 comments on commit 8306ea9

Please sign in to comment.