octopitus / rn-sliding-up-panel

Draggable sliding up panel implemented in React Native https://octopitus.github.io/rn-sliding-up-panel/
MIT License
929 stars 157 forks source link

[Question][Possible improvement] Add callback to show method #100

Closed filipef101 closed 5 years ago

filipef101 commented 5 years ago

Hello, great project. I was wondering is it possible to have a callback on the show method? Maybe also on close(I use the show method to close actualy btw)

octopitus commented 5 years ago

Can use InteractionManager to schedule a task after the animation/interaction. Example:

// This method is called when you click a button to hide the panel
hidePanel() {
  this.panel.hide()

  InteractionManager.runAfterInteractions(() => {
    // ...a long-running synchronous task...
  });
}
zapcriativo commented 5 years ago

Hi!

How to show another panel after panel.hide event finish?

I try to hide panel, change component inside of current panel e show panel again with another height state but dont work :(