Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BottomSheet resets to previous snap point when trying to track height #254

Open
Tasemu opened this issue Mar 29, 2023 · 0 comments
Open

Comments

@Tasemu
Copy link

Tasemu commented Mar 29, 2023

We have an issue where we need to track whether our bottom sheet is maximised or minimised in our app. The sheet is always open but can be either full screen or minimal at the bottom of the screen. We are trying to use onSpringEnd to set a local state but when we do this, the re-render seems to conflict with the sheet and causes it to jump back to its previous snap point?

const [height, setHeight] = useState(0);
 <Sheet
          open
          {....otherProps}
          ref={sheetRef}
          onSpringEnd=(() => { setHeight(sheetRef.height) })
          />
        }
      >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant