Replies: 1 comment
-
Sounds interesting, I'll try to have a look at the weekend |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently the render function of a component is only set once when the component is initially created. Even when the component is re-rendered the render function is not patched. This means that if the render function captures state that
state is never updated.
Take a look at the example code below:
Running the code below with our current implementation of components produces a stale
counterView
. ThecounterView
is never re-rendered.With the changed applied from the linked PR the
counterView
's render function is executed when the render function changes.As we don't want to patch the render function each time the component is re-rendered we need to detect if the render function captures state. I've included a prototype that does this via reflection per type and caches the result. I think we can make this work.
PR: #416
Beta Was this translation helpful? Give feedback.
All reactions