Closed
Description
Two ideas that came to mind:
a) when using the splitProps
fn I would love to define a target type that is used for autocompletion
b) when using the splitProps
fn it should fail on typecheck if not all props are destructured. so if a new property is added our build pipeline would fail
here is an example:
interface Maschine {
value?: string
newProperty?: string // was added recently
}
const [machineProps, rest] = splitProps<Maschine>(props, ["value", "newProperty"]) // OK
const [machineProps, rest] = splitProps<Maschine>(props, ["value"]) // Error -> missing value newProperty
Love to hear your thoughts @TimKolberger
Metadata
Metadata
Assignees
Labels
No labels