I'm currently developing a simple orders app which works ok on development, but if I install the apk from build or run the app on production mode through Expo Client I get this error:
TypeError: (0,f.useState) is not a function. (In '(0,f.useState)(!0)', '(0,f.useState)' is undefined)
This error is located at:
in C
in B
in RCTView
in View
in RCTView
in View
in RCTScrollView
in y
in ScrollView
in w
in P
in RCTView
in View
in RCTView
in View
in RCTView
in View
in ForwardRef
in RCTView
in View
in k
in ForwardRef
in PanGestureHandler
in Unknown
in RCTView
in View
in k
in ForwardRef
in RCTView
in View
in H
in Unknown
in RCTView
in View
in Unknown
in RCTView
in View
in Unknown
in w
in b
in RNCSafeAreaProvider
in Unknown
in Unknown
in RCTView
in View
in x
in Unknown
in Unknown
in O
in P
in RCTView
in View
in RCTView
in View
in O
in RCTView
in View
in f
in RCTView
in View
in AnimatedComponent(View)
in RCTView
in View
in AnimatedComponent(View)
in PanGestureHandler
in le
in L
in O
in P
in R
in O
in O
in l
in c
in Unknown
in Unknown
in RCTView
in View
in RCTView
in View
in C
My current config is:
This error doesn't happen at startup but when I reach a particular page.
Things I tried so far after reading a lot of QA about TypeError: (0,f.useState) is not a function:
React.useState instead of useState.Does anybody know how to fix this issue? Or what can I try to make it work? Regards!
I run the app in prod mode without --minify arg (expo start --no-dev) and I was able to fix this issue.
Debugging I found autocomplete imported useState from another instance of React which caused this issue.
Hope this helps anybody with this or similar issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With