router
router copied to clipboard
the `context` in the `onEnter` is callback on the Route definition returns `undefined` on first-load during runtime
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
- The application loaded and the console output
context from onEnter undefinedandcontext from loader {test: 'abc'} - Go to the
/aboutpage and back to/, the console outputcontext from loader {test: 'abc'}andcontext 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