Closed devoren closed 6 days ago
Thank you @devoren for issue and all the information ❤️
I'll try to see if I can use queueMicrotask
to solve the original problem when I added setImmediate
. Thank you again!
@devoren may I ask you to test https://github.com/kirillzyusko/react-native-keyboard-controller/pull/715 to confirm it fixes the problem?
@kirillzyusko Hey! Ok thank you! I'll try
@kirillzyusko Hello! I think #715 fixed the problem!
@devoren awesome! Merged it and will publish under 1.15.0
this month 😊
Describe the bug I get an error when I use react-native-keyboard-controller on the web. When i open website: If I use it in another page and not in the page that is open, then I can use it when I go to the page where I use react-native-keyboard-controller. But if I reload the tab in those pages that I use react-native-keyboard-controller or the first page uses react-native-keyboard-controller, then it will not have time to initialize somehow and gives an error: ReferenceError: setImmediate is not defined
I USED
npx expo export -p web
THENnpx serve dist --single
(same in the prod)Code snippet In my case i use KeyboardAwareScrollView
Repo for reproducing https://github.com/devoren/rnkc-web-bug
To Reproduce Steps to reproduce the behavior:
npx expo export -p web && npx serve dist --single
)Expected behavior Reload without any issues
Screenshots If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
Additional context This only happens when I build the expo web app via npx expo export -p web and if I use it in development mode it works without any issues.
As I see, setImmediate is used once in the codebase: https://github.com/kirillzyusko/react-native-keyboard-controller/blob/737e452faf39e1203d87f877517bd2177cd66ad9/src/internal.ts#L52
I hope that these issues and pulls can help: https://github.com/software-mansion/react-native-reanimated/issues/4140 https://github.com/software-mansion/react-native-reanimated/pull/4276