Does watching a provider inside a hook makes the hook rebuild the widget ? #363
Answered
by
rrousselGit
felipe-xavier
asked this question in
Q&A
-
Say we have a custom hook that watches a provider and a Widget that uses the hook. Will a change in the state of the provider cause a rebuild of the Widget using the hook? A Widget: Widget build(BuildContext context, WidgetRef ref) {
useCustomHook();
} useCustomHook: @override
void initHook() {
final state = ref.watch(customProvider);
...
} |
Beta Was this translation helpful? Give feedback.
Answered by
rrousselGit
Jul 3, 2023
Replies: 1 comment 2 replies
-
Yes, the widget will rebuild if the provider changes |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
felipe-xavier
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, the widget will rebuild if the provider changes