We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey @Sean-Bradley, a few observations:
exhaustive-deps
However, here the solution to your problem is pretty obvious:
const buttons = useMemo(() => { const _buttons = {} positions.forEach((p, i) => { _buttons['button ' + i] = button(() => setTo(p)) }) return _buttons }, [positions, setTo])
And if you're a fan of the reduce function:
const buttons = useMemo(() => positions.reduce((acc, p, i) => Object.assign(acc, { [`button ${i}`]: button(() => setTo(p)) }), {}), [positions, setTo])
Originally posted by @dbismut in #393 (comment)
The text was updated successfully, but these errors were encountered:
It seems you have created a new issue from an issue that was already solved and closed. #393 (comment)
Your problem is unclear because this is a verbatim copy of just one of the comments from the original thread.
Sorry, something went wrong.
No branches or pull requests
Hey @Sean-Bradley, a few observations:
exhaustive-deps
lint rule in general, as long as you know what you're doing. We actually do that a lot in Leva 🤧However, here the solution to your problem is pretty obvious:
And if you're a fan of the reduce function:
Originally posted by @dbismut in #393 (comment)
The text was updated successfully, but these errors were encountered: