How do we access a non-global flash-message?
See original GitHub issueI have figured out how to access the global FlashMessage component.
However, I want to have a second FlashMessage component positioned in another View in another screen.
I realize that the non-global FlashMessage is supposed to be like below with a ref. But, how do I access the non-global FlashMessage to show a message?
<FlashMessage ref="myNonGlobalFlashMessage" />
Or am I doing something completely wrong? What I am trying to accomplish is, I want to have this FlashMessage in a scrollview under the Header. So, I wrapped up my ScrollView with a View, and put the FlashMessage under the ScrollView. Pretty much like below,
<View>
<ScrollView> ...</ScrollView>
<FlashMessage.. />
</View>
But, I can’t get it to show a message.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to consume flash message in the browser? Passport ...
You can access flash messages using the request parameter ( req ). app.get('/User', function (req, res) { res.render('User', ...
Read more >actix_web_flash_messages - Rust - Docs.rs
Only show flash messages at info level or above in a production environment, while retaining debug level messages for local development;; Use different ......
Read more >NodeJS Essentials 38: Flash Messages - YouTube
In this tutorial, you'll learn how to add custom flash messages to a PassportJS login setup.In the previous tutorial, we setup a protected ......
Read more >Flash Messages - Pode
Flash messages allow you to pass temporary messages - info/error or otherwise - across multiple web requests via a user's current session.
Read more >Lesson 22. Adding sessions and flash messages
Currently, error messages are logged to the console, and users of the application have no way to know what they could do differently....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @aktasfatih and @spyr0s
If you work with “string” refs, you go like this:
this.refs.myNonGlobalFlashMessage.showMessage(....);
Like this sample working with native Modals: https://snack.expo.io/@lucasferreira/flash-message-modal-demo
Found this issue so far away, thank you for your help!
I use it this way in my custom component:
const flash = useRef(null);
<FlashMessage ref={flash} floating={true} />
then in your View or anywhere else you do:
flash.current.showMessage({})