gluestack / gluestack-ui

React & React Native Components & Patterns (copy-paste components & patterns crafted with Tailwind CSS (NativeWind))
https://gluestack.io/
MIT License
2.74k stars 120 forks source link

Toast Error on Expo SDK 49 on android and ios #1664

Open neverson-silva opened 10 months ago

neverson-silva commented 10 months ago

Description

TypeError: Cannot set property 'current' of null when using toast on android an ios

CodeSandbox/Snack link

NA

Steps to reproduce

i'm trying to use toast on expo sdk 49

on web I'm receiving the same error as related here https://github.com/gluestack/gluestack-ui/issues/1615

on android and ios I'm receiving another error

"TypeError: Cannot set property 'current' of null""

packages: "@gluestack-ui/toast": "^1.0.3", "@gluestack-style/react": "^1.0.38", "expo": "~49.0.15",

OS: Mac OS

I've tried with moti and @legendapp/motion

export const Wrapper = styled(AnimatedView, {}, { componentName: 'ToastAnimationWrapper', } as const);

export const useToast = createToastHook(Wrapper, AnimatePresence);

export const Description = styled(Text, {}, { componentName: 'ToastDescription', ancestorStyle: ['_description'], } as const);

const Root = styled(View, {}, { componentName: 'Toastg', descendantStyle: ['_icon', '_title', '_description'], } as const);

const Title = styled(Text, {}, { componentName: 'ToastTitle', ancestorStyle: ['_title'], } as const);

export const Toast = createToast({ Root, Title, Description, });

gluestack-ui Version

"@gluestack-ui/toast": "^1.0.3"

Platform

Other Platform

No response

Additional Information

No response

surajahmed commented 9 months ago

@neverson-silva Thanks for reporting this. We'll try to reproduce and update you on this. You can try out Expo SDK 48 for now.

jezzdk commented 9 months ago

I see it too. The error occurs just by inserting the line const toast = useToast().

tohsaka888 commented 8 months ago

Any solution to fix it?

drewjenkins commented 7 months ago

Would love to use this component, looks way better than alternatives, bu running into this issue as well. Expo SDK 50