Persistence and Sharing
Tables need memory, but not all memory means the same thing.
react-datatable separates remembered state into three concepts:
- private persistence
- saved views
- URL sharing
They can store similar table state, but they have different product meanings.
Private Persistence
Private persistence answers: continue where I left off.
It quietly remembers one user's current table setup. That can include filters, sorting, grouping, visible columns, column order, sizing, and the active view.
A typical case is a team meeting. You filter the customers table, scroll to the right area, and open one customer to discuss the details on a separate route. When you press the browser back button, you expect to return to the same filtered table, at the same page and scroll position, without rebuilding the context by hand.
In react-datatable, persisted table state restores the filter and layout context. Runtime restoration uses the same table identity to bring back pagination and scroll position during SPA navigation.
This should feel automatic. The user does not name anything. They return to the table and it feels familiar.
Use persistence for personal working state.
Saved Views
Saved views answer: take me back to this named setup.
A saved view is deliberate. It has a name and can become part of the product workflow: "Renewals", "At risk accounts", "My open issues", or "Finance review".
Saved views can also support defaults:
- a workspace default for the team
- a user default for one person
Use saved views when a table setup should be reusable, named, or shared as a team convention.
URL Sharing
URL sharing answers: show someone this view right now.
The URL should carry only the state needed to reproduce the meaningful view: usually search, filters, sorting, grouping, and filter mode.
It should not carry every personal display preference. A copied link should communicate the useful context, not another user's private workspace.
Use URL state for one-off sharing and deep links.
The Difference
Use this mental model:
| Feature | Meaning | Visibility |
|---|---|---|
| Persistence | Continue my work | Private |
| Saved views | Return to a named setup | Private or shared |
| URL state | Open this exact context | Shared by link |
This separation keeps the table predictable. A private preference should not accidentally become a team default. A shared link should not permanently change someone's remembered state.
Defaults and Remembered State
Defaults are starting points. Persisted state is recent work.
If a user has no remembered state, a workspace or user default view can shape the first load. If they do have remembered state, the table should usually restore that instead.
Shared URL state still wins because opening a link is intentional.
Copy Link vs URL Sync
There are two ways to use URLs.
Copy link exports the current shareable state when the user asks for it. This is usually the calmer default for product tables.
Continuous URL sync keeps the address bar updated as the table changes. Use it when the URL itself is part of the product experience.
Both use the same idea: URLs carry shared context, not every private table preference.
Use This Rule
Put state in the place that matches its meaning:
- personal and automatic: persistence
- named and reusable: saved views
- portable and temporary: URL sharing
Next Steps
- See startup precedence in State Lifecycle.
- Configure private memory in Add current-view persistence.
- Configure named views in Add saved views.
- Configure links in Add copy links and Add URL sync.