Skip to content

[Bug]: Using hash with lazy component results in an empty page on initial load #10469

@erism

Description

@erism

What version of React Router are you using?

6.11.1

Steps to Reproduce

Add any hash value to route that uses lazy component and refresh the page.

Example codesandbox

Expected Behavior

Using hash shouldn't cause route matching problem.

Actual Behavior

It results in an empty page with console warning:
Matched leaf route at location "/path#hash" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.

  • Navigation with hash doesn't cause this problem; it only occurs on initial load.
  • It's broken after 6.11.1 upgrade. 6.11.0 works normally.

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