tweakpane / use-tweaks

🎛️ Tweak React components with Tweakpane
https://codesandbox.io/s/use-tweaks-example-58e02
MIT License
768 stars 23 forks source link

Keep state & order on HMR/FR #27

Closed gsimone closed 3 years ago

gsimone commented 3 years ago

Plan:

We can use schema/name as keys, creating an out-of-react state:

state[generateKey(name,schema)] = value

This object is used at reload to

  1. regenerate panes in original order
  2. preserve state on unmounting/reloading

Tweaks with identical settings would be ambiguos, we need to catch this and warn + add documentation