magicismight / react-native-root-toast

react native toast like component, pure javascript solution
MIT License
2.08k stars 403 forks source link

Doesn't work with latest Expo #175

Open robertmylne opened 8 months ago

robertmylne commented 8 months ago

Bare bones expo project latest version and no toast.

import {router, Stack, useRouter} from "expo-router"
import {useEffect} from "react"
import { RootSiblingParent } from 'react-native-root-siblings';
import Toast from "react-native-root-toast"
import {Text, TouchableOpacity, View} from "react-native"

export default function RootLayout() {

    return (
        <RootSiblingParent>
            <View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
            <TouchableOpacity onPress={() => {
                Toast.show('Test', {
                    duration: 5000 ,
                });
            }}>
                <Text>test</Text>
            </TouchableOpacity>
            </View>
        </RootSiblingParent>
    )
}
liquid36 commented 8 months ago

I had a similar error. Try installing react-native-root-siblings@^4.0.0.

hichemfantar commented 5 months ago

checkout https://github.com/calintamas/react-native-toast-message

pgill-rbi commented 3 months ago

@liquid36 solution worked for me!!!

jeremyjone commented 1 month ago

I had a similar error. Try installing react-native-root-siblings@^4.0.0.

It worked for me~~

My env: react-native@0.74.3 react-native-root-toast@3.6.0 expo@^51