Skip to content

Objects no longer automatically optional

Latest
Compare
Choose a tag to compare
@aikmandean aikmandean released this 05 Jul 06:14
· 26 commits to master since this release
cefe118

Type signature update for objects (unreleased)

Changing how objects are compared to the editor. A type-level only change.

Explanation

Before the release of the builtin metadata "default", no props were nullable. After the update, all objects are nullable by default. This marks the reverting change back to non-nullable for objects. Objects can be nullable by using HasFallback or passing default: true to defineProp.

Status

Unreleased to NPM

Code Example

const Person = defineProp({ age: 0 })
const OptionalPerson = defineProp({ age: 0 }, { default: true })

Objects, or any type, can still be optional by passing default: true. Objects are no longer optional automatically.