We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents afc59e4 + 117055f commit bfb9b95Copy full SHA for bfb9b95
package/timeJump.js
@@ -16,7 +16,14 @@ module.exports = (origin, mode) => {
16
const originNode = traverseTree(origin.tree, coords);
17
// set the state of the origin tree if the component is stateful
18
if (originNode.component.setState) {
19
- originNode.component.setState(target.state, () => {
+ originNode.component.setState((prevState) => {
20
+ Object.keys(prevState).forEach((key) => {
21
+ if (target.state[key] === undefined) {
22
+ target.state[key] = undefined;
23
+ }
24
+ })
25
+ return target.state;
26
+ }, () => {
27
// iterate through new children once state has been set
28
target.children.forEach((child, i) => {
29
jump(child, coords.concat(i));
0 commit comments