Skip to content

<link> elements doesn't move inside <head> when using createBrowserRouter #13176

@NagayamaToshiaki

Description

@NagayamaToshiaki

I'm using React Router as a...

framework

Reproduction

Go to https://stackblitz.com/edit/vitejs-vite-qsvgns2s

System Info

Node.js 20.14.0

Used Package Manager

npm

Expected Behavior

As you move the pages, following will happen:

  1. <title> will be replaced with ones added by the component routed.
  2. <link>, <style>, <meta> goes inside <head> element.

Actual Behavior

Only <meta> works as intended.

  1. <title> will be added above the <title> you set in index.html. So 2 titles are set, which doesn't comply HTML spec.
  2. <link>, <style>, will be at the place you wrote those.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions