Giter VIP home page Giter VIP logo

Comments (11)

chiragbhaiji avatar chiragbhaiji commented on July 20, 2024 3

In my case memoizing the Toast component worked.

I created a wrapper component like the following:

const CustomToast = React.memo(() => <Toast config={toastConfig} />)

And then used it in place of

<Toast config={toastConfig} />

from react-native-toast-message.

chetanbhadarka avatar chetanbhadarka commented on July 20, 2024 1

I also facing same issue, I have setup Toast in App.js file and using redux I'm showing toast in app. It's working fine as expected but only in one use-case it's not working fine. Facing issue only for android.

Use Case:

  • I've facebook login implement with firebase and I'm using react-native-fbsdk-next dependency for it.
  • when i press facebook login button it'll start to show my custom loading screen as animated view with position absolute.
  • but somehow while i press fb login button, empty toast is appeared on the top of the screen(as you can see in video).
  • also I verified that toast is not calling from redux side. then why should it appeared.

I can provide more details as per needed. thank you in advance.

Screen.Recording.2024-01-30.at.10.06.22.AM.1.mp4

from react-native-toast-message.

vgsnv avatar vgsnv commented on July 20, 2024

I'm facing the same problem. When requesting media rights, popped up. It turned out to be fixed only by changing the Toast type string. Was 'messenger' became 'messenger-asdfasdf'

from react-native-toast-message.

SMJ93 avatar SMJ93 commented on July 20, 2024

I had the same issue - I fixed by adding a check for text1 to my custom Toast component. If no text1 is set, return null:

const Toast = ({type, text1}: PropTypes) => {
  const {backgroundColor, IconComponent} = toastTypes[type];

  if (!text1) {
    return null;
  }

  return (
    <SafeAreaView edges={['top']} style={[styles.container]}>
    ...
    </SafeAreaView>
  );
};

from react-native-toast-message.

MilanBarande avatar MilanBarande commented on July 20, 2024

I am encountering the same issue as you @chetanbhadarka when I open a browser page from within the app. Did you end up finding any solution? I tried explicitly calling the hide method before I open the link but with no success

from react-native-toast-message.

chetanbhadarka avatar chetanbhadarka commented on July 20, 2024

I am encountering the same issue as you @chetanbhadarka when I open a browser page from within the app. Did you end up finding any solution? I tried explicitly calling the hide method before I open the link but with no success

@MilanBarande, Not yet brother.

from react-native-toast-message.

MilanBarande avatar MilanBarande commented on July 20, 2024

I have tweaked an ugly hack. Keeping a boolean in a context to conditionally render the RNToast component in my root component. When I need to open a browser link, I set this boolean to false. It's working, but I really don't like it, as I'm causing unnecessary re-rendering to my entire components tree...
@chetanbhadarka

from react-native-toast-message.

sainjay avatar sainjay commented on July 20, 2024

Facing the same problem in Expo 50, show up the Toast at top without calling it. Places i observed it shows up:

  1. Expo Debugger is open
  2. When requesting Device permissions

IMG_0785

from react-native-toast-message.

alainib avatar alainib commented on July 20, 2024

@sainjay try a patch package

Capture d’écran 2024-05-21 à 10 04 02

from react-native-toast-message.

sainjay avatar sainjay commented on July 20, 2024

@alainib Can you share the link for patch file too 😀

@sainjay try a patch package

Capture d’écran 2024-05-21 à 10 04 02

from react-native-toast-message.

alainib avatar alainib commented on July 20, 2024

@alainib Can you share the link for patch file too 😀

@sainjay try a patch package
Capture d’écran 2024-05-21 à 10 04 02

diff --git a/node_modules/react-native-toast-message/lib/src/hooks/useSlideAnimation.js b/node_modules/react-native-toast-message/lib/src/hooks/useSlideAnimation.js
index 33f0b87..97e2423 100644
--- a/node_modules/react-native-toast-message/lib/src/hooks/useSlideAnimation.js
+++ b/node_modules/react-native-toast-message/lib/src/hooks/useSlideAnimation.js
@@ -16,7 +16,7 @@ export function useSlideAnimation({ position, height, topOffset, bottomOffset, k
     const animate = React.useCallback((toValue) => {
         Animated.spring(animatedValue.current, {
             toValue,
-            useNativeDriver,
+            useNativeDriver: false,
             friction: 8
         }).start();
     }, []);

from react-native-toast-message.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.