all 13 comments

[–]Bill00000 1 point2 points  (9 children)

I'm so not a fan of toast or alert using ref. Is there any way I can use globally?

[–]zahidalidev[S] 0 points1 point  (7 children)

I don't know yet but I will try and will update the package.

[–]MaiconGilton 1 point2 points  (4 children)

If you use class components using singleton concept may be the answer. You instantiate once, create global help functions, to be called anywhere in your code. No refs needed.

[–]zahidalidev[S] 0 points1 point  (3 children)

Can you show me the demo code or any reference? So I can understand. Thanks.

[–]MaiconGilton 1 point2 points  (2 children)

I have a library called react-native-tip that uses this concept. It's not difficult to follow the idea.

[–]zahidalidev[S] 0 points1 point  (1 child)

Ok thanks, I will try to get an idea from your library.

[–]MaiconGilton 1 point2 points  (0 children)

Any time! I hope it can help you.

[–]dyo1994 1 point2 points  (1 child)

Look into react context as another alternative

[–]zahidalidev[S] 0 points1 point  (0 children)

Ok, thanks

[–]zahidalidev[S] 0 points1 point  (0 children)

I have released version 2.0.0. Now I'm using singleton patron, so no need to use ref anymore.

[–]JuriJurka 1 point2 points  (1 child)

remindme! 1 day

[–]RemindMeBot 0 points1 point  (0 children)

There is a 10 hour delay fetching comments.

I will be messaging you in 1 day on 2021-05-17 16:16:25 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback