router icon indicating copy to clipboard operation
router copied to clipboard

the `context` in the `onEnter` is callback on the Route definition returns `undefined` on first-load during runtime

Open Zebeqo opened this issue 1 year ago • 0 comments

Describe the bug

When first loading, onEnter runs before loader and context in onEnter is always undefined.

Your Example Website or App

https://stackblitz.com/edit/github-h2bsvy

Steps to Reproduce the Bug or Issue

  1. The application loaded and the console output context from onEnter undefined and context from loader {test: 'abc'}
  2. Go to the /about page and back to /, the console output context from loader {test: 'abc'} and context from onEnter {test: 'abc'}

Expected behavior

The application loaded and the console output context from loader {test: 'abc'} and context from onEnter {test: 'abc'}

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: 124.0

Additional context

No response

Zebeqo avatar Apr 29 '24 05:04 Zebeqo