Closed
Description
State is not always flat and sometimes it can make sense to destructure it directly. Example:
const [{foo, bar, baz}, setFooBarBaz] = useState({foo: "omg", bar: "wtf", baz: "bbq"})
const [[index, value], setValueWithIndex] = useState([0, "hello"])
Note that in these cases the setter name can not be symmetrical to the destructured variables.
It would be nice if react/hook-use-state
permitted this use case (maybe optional?).
Either way, thanks for the great work! 👍