Skip to content

[BUG] Can not programatically set field value to null #82

Open
@tbydza

Description

@tbydza

I need to set field value programatically, but sometimes the value is null or undefined.

// example
const name = field('name', '');
name.set(null);

If I call set method with null parameter it causes this error:

TypeError: Cannot convert undefined or null to object

It is caused by const keys = Object.keys(field); in function isField .

Is it feature or bug?
I can work around it with this:

const fieldObj = get(name);
fieldObject.value = null;
name.set(fieldObj);

But it seems unnecessarily complicated.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions