-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Labels
Description
Reproduction
<Navbar>
{ loading ? <Loading/> :
<>
<div className="mt-20"></div>
{children}
</>
}
</Navbar>with this snippet in root.tsx my route's Component with inline script renders without a problem, however when put like:
{ loading ? <Loading/> :
<Navbar>
<div className="mt-20"></div>
{children}
</Navbar>
}it breaks the inline script in my component, which does not make sense
Source
Files
-
https://github.com/Z3NTL3/ersoy-frontend-blog/blob/main/app/root.tsx#L70
-
https://github.com/Z3NTL3/ersoy-frontend-blog/blob/main/app/components/ui/navbar.tsx
-
https://github.com/Z3NTL3/ersoy-frontend-blog/blob/main/app/routes.ts
Dont see what is wrong
System Info
✦ ❯ npx envinfo --system --npmPackages '{vite,react-router,@react-router/*}' --binaries --browsers
System:
OS: Linux 6.11 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
CPU: (16) x64 AMD Ryzen 7 4800H with Radeon Graphics
Memory: 7.91 GB / 15.04 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 22.17.1 - ~/.nvm/versions/node/v22.17.1/bin/node
npm: 10.9.2 - ~/.nvm/versions/node/v22.17.1/bin/npm
Browsers:
Brave Browser: 138.1.80.113
Chrome: 138.0.7204.92
Chromium: 138.0.7204.157
npmPackages:
@react-router/dev: ^7.7.1 => 7.7.1
@react-router/express: ^7.7.1 => 7.7.1
@react-router/node: ^7.7.1 => 7.7.1
@react-router/serve: ^7.7.1 => 7.7.1
react-router: ^7.7.1 => 7.7.1
vite: ^6.3.3 => 6.3.5 Used Package Manager
npm
Expected Behavior
It should not affect the inline script of my component whether when I use the latter code snippet, it makes no sense that it breaks up the inline script
Actual Behavior
Both way the inline script should execute and work