bvaughn / react-resizable-panels

https://react-resizable-panels.vercel.app/
MIT License
3.87k stars 135 forks source link

[Enhancement] Provide "null" storage to avoid persistence in localstorage #302

Closed lukasbash closed 7 months ago

lukasbash commented 7 months ago

Right now we have to pass a custom crafted null-ish storage to avoid local storage persistence:

export const nullPanelStorage: PanelGroupStorage = {
  getItem: () => null,
  setItem: () => {},
};

It would be awesome if we could just pass null as a storage or even get a boolean flag for disabling the persistence at all.

bvaughn commented 7 months ago

Right now we have to pass a custom crafted null-ish storage to avoid local storage persistence

That is the default behavior you're describing. Don't specify an autoSaveId prop and the panel won't save anything to local storage.