Open ealmloff opened 2 weeks ago
I can think of two different ways to fix this issue:
1) Introduce an extra layer of interior mutability in every ReadOnlySignal that allows you to update the signal it points to in place. Instead of moving the readonlysignal out of the props, we could just make the readonlysignal in the component point to the new signal. This is non-breaking, but it introduces a performance penalty for all readonlysignals
2) Introduce a difference between the mounted and unmounted props. The unmounted props for TakesReadOnlySignal { sig: generation() as i32 }
could be the i32
value which is cloned along with the component. The ReadOnlySignal could then be created in the child component instead of moved out of the props
Problem
Any props with the T -> ReadOnlySignal logic fail to diff if you try to render it multiple times:
This is the signal version of the EventHandler problem fixed in #2298
Steps To Reproduce
Run this code:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
master
nightly
all
Questionnaire