leva
leva copied to clipboard
setting control values should ignore unknown keys rather than throwing
const [params, setParams] = useControls(() => {
If you pass an object to setParams that includes a key that doesn't match to an existing parameter, it throws an error and Leva stops working.
It's a common to have defaults objects for your components which may include more keys than you actually want exposed with Leva controls. For instance, we often have a seed prop, but most of our Leva examples don't need to expose a control for seed.
It'd be better DX if you can pass extra keys to setParams that are ignored (or could be console.warned). Otherwise we need to create another type and object specific to Leva.