Skip to content

Improve useTabStateSync dependencies and setter memoization #2

@robertluiz

Description

@robertluiz
  • In the React hook, the whole options object is passed as a useEffect dependency. This means the effect will re-run on every render unless the user memoizes the options or defines them outside the render function—which most users probably won’t do.

  • Also, the setter function returned by the hook could be memoized with useCallback, to avoid breaking memoization in user components that depend on it.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions