router icon indicating copy to clipboard operation
router copied to clipboard

Route.update() does not update state options.

Open itshallrun opened this issue 1 year ago • 0 comments

Describe the bug

Using Route.update() does not update options in state, especially staticData.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-bjnyvy?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. go to reproduction example
  2. create a route or check the existing root route
  3. trigger a Route.update({staticData: {someStaticValue: "updated value"})
  4. The returned object from Root.update() does have the updated options
  5. The state in the tanstack router devtools, or when retrieved by useMatches or else, does not have the updated options

Expected behavior

The state should update reactively. All components depending on the state (components with useMatches and so on) should rerender and show the updated state options.

Screenshots or Videos

image

Platform

  • OS:macOS
  • Browser: Chrome
  • Version: 126.0.6478.63

Additional context

No response

itshallrun avatar Jul 01 '24 11:07 itshallrun