Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toast does not show on Modal on react native 0.75.3 #181

Open
arlovip opened this issue Oct 24, 2024 · 8 comments
Open

Toast does not show on Modal on react native 0.75.3 #181

arlovip opened this issue Oct 24, 2024 · 8 comments

Comments

@arlovip
Copy link

arlovip commented Oct 24, 2024

As descriped, Toast does not show on Modal on react native 0.75.3.

It works well without Modal.

Code snippets:

import {Button, Modal, View} from "react-native";
import {useState} from "react";
import {RootSiblingParent} from "react-native-root-siblings";
import Toast from "react-native-root-toast";

export default function ProfilePage(props) {
	const [visible, setVisible] = useState(false);
	return (
		<View style={{flex: 1, paddingTop: 100}}>
			<Button title={"Show Toast"} onPress={() => {
				// This works well!
				Toast.show("Hello, world", {
					duration: 2000,
					position: Toast.positions.CENTER,
				});
			}}/>
			<Button title={"Show Modal"} onPress={() => setVisible(true)}/>
			<Modal visible={visible}>
				<RootSiblingParent>
					<View style={{flex: 1, backgroundColor: "red", paddingTop: 300}}>
						<Button title={"Show Toast on Modal"} onPress={() => {
							// This does not work on modal???
							Toast.show("Hi, how are you?", {
								duration: 2000,
								position: Toast.positions.CENTER,
							});
						}}/>
						<Button title={"Close Modal"} onPress={() => setVisible(false)}/>
					</View>
				</RootSiblingParent>
			</Modal>
		</View>
	);
}
@arlovip
Copy link
Author

arlovip commented Oct 24, 2024

I tried RN 0.75.4(new project), the issue also exists!

@kot-ezhva
Copy link

I tried RN 0.75.4(new project), the issue also exists!

UP! I have some issue

@ningacoding
Copy link

ningacoding commented Nov 14, 2024

Not working on project with:

"expo": "~51.0.38",
"react": "18.2.0",
"react-native": "0.74.5",
"react-native-root-toast": "^3.6.0",

neither modal or any other place (like rootView).

@NiishantGautam
Copy link

Not working on project with:
"expo": "52.0.7", "expo-constants": "17.0.3", "expo-linking": "7.0.2", "expo-router": "4.0.6", "expo-status-bar": "2.0.0", "react": "18.3.1", "react-native": "0.76.2", "react-native-root-toast": "^3.6.0", "react-native-safe-area-context": "4.12.0", "react-native-screens": "4.0.0"

@Maxim-Fursa
Copy link

Same, doesnt work anywhere with latest RN and expo

@tozz
Copy link

tozz commented Nov 20, 2024

Same, doesnt work anywhere with latest RN and expo

So it's not only me then 😅 Don't know if this project is abandoned or not, might just have to look for an alternative.

@Maxim-Fursa
Copy link

Same, doesnt work anywhere with latest RN and expo

So it's not only me then 😅 Don't know if this project is abandoned or not, might just have to look for an alternative.

Actually kind of solved the problem by using ToastAndroind from react-native and Alert for IOS. Didnt find better solution

@ningacoding
Copy link

ningacoding commented Nov 22, 2024

Same, doesnt work anywhere with latest RN and expo

So it's not only me then 😅 Don't know if this project is abandoned or not, might just have to look for an alternative.

Actually kind of solved the problem by using ToastAndroind from react-native and Alert for IOS. Didnt find better solution

Actually i solved the problem by creating a toast component by myself xd

no RootSiblingParent sht needed xd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants