fix(view): fix the forwardRef functionality for view#5
fix(view): fix the forwardRef functionality for view#5cristianbote wants to merge 2 commits intomasterfrom
Conversation
|
The code looks great to me, but for some reason it's not rerendering when the store changes. I have no idea why 😅 |
I've recorded this reply https://www.loom.com/share/b98cdb54e51d45c6b024a0f1465e68f8 TL;DR; at the end of the day, forwardRef wraps the memoed render function but it should be the other way around. Still investigating it. |
|
How bad is to do |
That doesn't work either. I mean that's what we do right now. Yesterday though, I went on anther direction with it, and I think it's all related to how |
I'm not sure what you mean by that. The way it works is by wrapping the component in an The The computation tracks all the reads done during the computation execution. This should work just fine: The rerender is triggered by the |
|
Now that we use a reference ( EDIT: This is what I was trying. |
|
Additional thing to consider is that a forwardRef component is an object with a There is known bug which is that I was able to get around it by changing this line to: However, I did not dig deep enough to be 100% certain that it's the complete solution. PS. This should be fixed in https://github.com/frontity/observer-util, but I'm documenting this here for completeness. |
|
For context, Cris is trying to fix this in: frontity/observer-util#2 I asked him if we could do this in |
|
Hey guys, what is the status of this? Any progress? 🙂 |
Resolves frontity/frontity#773
Proposed changes:
This one fixes the
forwardRefusage together with theviewcomponents.This was part of our pair programming session @luisherranz. Let me know if I borked something up 😄