Skip to content

simplebar-react: recalculate() - Method Undefined on Ref Object #704

Open
@Euclidean-Dev

Description

Describe the bug
I am encountering an issue with simplebar-react where the recalculate() method does not seem to exist on the ref object as suggested by some parts of the documentation or community examples. This is causing difficulties in managing dynamic content sizes in React.

To Reproduce
Steps to reproduce the behavior:

  1. Go to my CodeSandbox example: EXAMPLE OF ISSUE HERE.
  2. Observe the console output after component mounts.
  3. Notice that the recalculate() method is undefined on the SimpleBar ref.

Expected behaviour
I expect to be able to call ref.current.recalculate() to adjust the scrollbar when the content size changes dynamically.

Actual behaviour*
The ref.current.recalculate() is undefined, and thus I cannot invoke this method to manage dynamic content changes.

Reproducible example
See codesandbox link above.

Additional context
N/A

Your environment

Software Version(s)
SimpleBar Latest
Browser Any
npm/Yarn n/a
Operating System Any

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions