Merge pull request #980 from eefano/little-bag-fix
little fix for withVal
This commit is contained in:
commit
446cf8c694
1 changed files with 3 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ export function createParam(names) {
|
|||
let bag;
|
||||
// check if we have an object with an unnamed control (.value)
|
||||
if (typeof xs === 'object' && xs.value !== undefined) {
|
||||
bag = xs; // grab props that are already there
|
||||
bag = { ...xs }; // grab props that are already there
|
||||
xs = xs.value; // grab the unnamed control for this one
|
||||
delete bag.value;
|
||||
}
|
||||
|
|
@ -28,7 +28,8 @@ export function createParam(names) {
|
|||
});
|
||||
return result;
|
||||
} else if (bag) {
|
||||
return { ...bag, [name]: xs };
|
||||
bag[name] = xs;
|
||||
return bag;
|
||||
} else {
|
||||
return { [name]: xs };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue