Giter VIP home page Giter VIP logo

Comments (6)

jeetvani avatar jeetvani commented on July 20, 2024 4

@jmada @Alan-Graton try adding <Toast /> in the bottom of StackNavigation

export default function App() {
  return (
    <>
      <SafeAreaProvider>
        <RootSiblingParent>
          <Home />
          <StatusBar style="inverted" />
          <Toast />  //  in the bottom of other components
        </RootSiblingParent>
      </SafeAreaProvider>
    </>
  );
}

Works For Me

from react-native-toast-message.

Alan-Graton avatar Alan-Graton commented on July 20, 2024 3

Same over here:

App.tsx

import { StatusBar } from "expo-status-bar";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { RootSiblingParent } from "react-native-root-siblings";
// Screens
import { Home } from "./src/screens/Home/Home";
// Styles
import Toast from "react-native-toast-message";

export default function App() {
  return (
    <>
      <SafeAreaProvider>
        <RootSiblingParent>
          <Toast />
          <Home />
          <StatusBar style="inverted" />
        </RootSiblingParent>
      </SafeAreaProvider>
    </>
  );
}

Home.tsx(calling Toast)

import { Toast } from "react-native-toast-message/lib/src/Toast";

export function Home() {
function handleCreate(task: string): void {
    if (tasks.find((el) => el.description === task)) {
      // FIXME: Toast not displaying
      Toast.show({
        type: "error",
        text1: "Opa!",
        text2: "Você já cadastrou uma tarefa igual a essa",
      });
      return;
    }

    setTasks((prev) => [...prev, { description: task, status: "unchecked" }]);
  }
  {...}
}

Environment

  • Windows 10
  • react-native version: 0.72.5
  • react-native-toast-message: ^2.1.6

from react-native-toast-message.

KaviduAloka avatar KaviduAloka commented on July 20, 2024 3

@jmada @Alan-Graton try adding <Toast /> in the bottom of StackNavigation

export default function App() {
  return (
    <>
      <SafeAreaProvider>
        <RootSiblingParent>
          <Home />
          <StatusBar style="inverted" />
          <Toast />  //  in the bottom of other components
        </RootSiblingParent>
      </SafeAreaProvider>
    </>
  );
}

from react-native-toast-message.

Alan-Graton avatar Alan-Graton commented on July 20, 2024 3

@jmada @Alan-Graton try adding <Toast /> in the bottom of StackNavigation

export default function App() {
  return (
    <>
      <SafeAreaProvider>
        <RootSiblingParent>
          <Home />
          <StatusBar style="inverted" />
          <Toast />  //  in the bottom of other components
        </RootSiblingParent>
      </SafeAreaProvider>
    </>
  );
}

@KaviduAloka Thanks for the tip, will give a try

from react-native-toast-message.

jmada avatar jmada commented on July 20, 2024 1

@jmada @Alan-Graton try adding <Toast /> in the bottom of StackNavigation

export default function App() {
  return (
    <>
      <SafeAreaProvider>
        <RootSiblingParent>
          <Home />
          <StatusBar style="inverted" />
          <Toast />  //  in the bottom of other components
        </RootSiblingParent>
      </SafeAreaProvider>
    </>
  );
}

Worked for me! Thank you so much. I'm closing the issue. :)

from react-native-toast-message.

gemasaputera avatar gemasaputera commented on July 20, 2024

I faced the same problem, any updates for this issue ?

  return (
<>
    <ContextProvider>
      <Navigation />
      <Button title="Sign out" onPress={signOut} />
    </ContextProvider>
    <Toast />
</>
  );

I've added in the bottom of my App.tsx

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.