Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing variables to a declarative router does not trigger a rebuild with new info #2125

Open
dickermoshe opened this issue Jan 9, 2025 · 2 comments

Comments

@dickermoshe
Copy link

e.g.

final id = useState(1);
return AutoRouter.declarative(
    routes: (handler) {
      return [
        HomeRoute(id: id.value),
      ];
    },
  );

Updating the id above will not trigger a rebuild.
The solution to this problem is too use keys.

I've opened a PR here: #2084

@Phat0M
Copy link

Phat0M commented Jan 11, 2025

why you can't use other ways to provide value? For example inherited widget.

@dickermoshe
Copy link
Author

@Phat0M
That's a workaround, but a truly declarative router should react to state changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants