question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feat: passing data to present() and dismiss()

See original GitHub issue

Feature Request

I miss the possibility to send and receive data to the BottomSheet. Many modal sheets are not in context with each other and currently I have to work with event emitters.

Why it is needed

I use the sheets to show partial screens with settings, or to offer single/multiple choices. The modals are generic and are therefore not a coherent stack. So that I know, for example, after closing, which data has been selected, the passing of data would be very helpful. Currently I use EventListener for this.

Possible implementation

The library should detect if it has an underlying sheet at all at dismiss and pass through the data if it does. If no further sheet opens after the dismiss, no data must be passed through. Passed data via present() or dismiss() should update the state, maybe using a hook.

Code sample

   bottomSheetRefNew.current.present({ data })
   bottomSheetRef.current.dismiss({ data })

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:11

github_iconTop GitHub Comments

2reactions
hirbodcommented, Apr 8, 2022

Dear annoying Github Bot, its not stale 😄

1reaction
zfantacommented, Jul 10, 2022

@mouricef

<BottomSheetModal {...yourProps}>
  {props => {
    console.log(props);
    return (
      <View style={styles.contentContainer}>
        <Text>Awesome 🎉</Text>
      </View>
    );
  }}
</BottomSheetModal>
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to pass data to another controller on dismiss ...
The best way to pass data back to the previous view controller is through delegates... when going from ViewController A to B, pass...
Read more >
How to present and dismiss intermediate view controllers?
I'm trying to figure out the best way to correctly present and dismiss view controllers in Swift. ... present(VC2(), animated: true completion: nil)....
Read more >
Examples — Bootbox.js — alert, confirm, prompt, and flexible ...
Dismiss with overlay click. Also applies to: Confirm, Prompt, Custom. Run example. bootbox.alert({ message: 'This alert can be dismissed by clicking on the ......
Read more >
Tailwind CSS Alerts - Flowbite
The Dismiss class from Flowbite can be used to create an object that will hide a target element or elements based on the...
Read more >
Send a card message | Google Chat
In addition to text messages, Chat apps can send card messages in spaces and to ... Chat app responding with a card featuring...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found