Problem with provisioning of my InheritedWidget
Closed this issue · 5 comments
Interesting is that after reload it looks good but after one second I see error message:
https://github.com/user-attachments/assets/5c6180c4-ba28-4233-b3b4-6b4209d9ae56
Yes I guess Theme is only server-side rendered but you try to access it also from a client component.
Check the hydration docs, specifically the section about the server vs client gap.
Tbh for this use-case (inherited component somewhere up the tree, needs to be accessed further down on the client) I don't have a good solution right now (... but something I'm working on really cool)
Your choices right now are pretty much limited to
a) put the InheritedWidget in a client component or
b) don't access it from the client
Ok, so if I understand correctly, I have to provide my inherited widget inside every page or component annotated by @client annotation.
Now when I added my inherited widget into my Home page so it works.
Seems like this is done.