Why this approach is not recommended:
string | null
!
.transform()
Better alternatives:
useWatch (typed as T | null naturally):
name: null
email: null
Address *
The problem in onSubmit:
function onSubmit(data) { // data.name is string | null // even though validation passed! const name = data.name!; // Need ! }