Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

useInput #21

Open
dy opened this issue Dec 19, 2019 · 0 comments
Open

useInput #21

dy opened this issue Dec 19, 2019 · 0 comments

Comments

@dy
Copy link
Owner

dy commented Dec 19, 2019

Must useInput(name) create ref, if no corresponding element found?

let [ref, setValue] = useInput(name)

Nope, value must be first, ref is an argument.

But what if combine value with input?

let [{ value, ref, error, disabled }, { disable, validate, set, get, reset }] = useInput(name, default)
// or better keep convention
let [value, { ref, error, disabled, disable, validate, set, get, reset }] = useInput(name, default)
let { value, ref, error, disabled, disable, validate, set, get, reset } = useInput(name, default)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant