Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createForm() {
if (!options.initialValues) return
const form = new Form(options)
setForm(form)
const unsubscribe = form.subscribe(
form => {
setValues(form.values)
},
{ values: true }
)
return () => {
unsubscribe()
}
},
[options.id, !!options.initialValues]