3 ms·
It's not some big mystery and it's documented just fine. If you have a normal chunk of static jsx, child "i" maps to slot "i". If you wish to omit a child dyna
by unconed 4y ago
It's not some big mystery and it's documented just fine.
If you have a normal chunk of static jsx, child "i" maps to slot "i". If you wish to omit a child dynamically, you put a null in its place.
If you have an array of children being built dynamically, every child needs an explicit key. This avoids state being shifted up and down needlessly when you add/remove.
You will never get another component's state back because changing the type forces a remount.
Unlike React, Live has the ability to preserve children even if the parent type changes (a morph), but this is opt-in only and will still discard the state of the parent.