troberts-28 / react-native-timer-picker

A simple, flexible, performant duration picker for React Native apps (Expo & Bare Workflow). Great for timers, alarms and duration inputs. Includes iOS-style haptic and audio feedback.
https://www.npmjs.com/package/react-native-timer-picker
MIT License
142 stars 19 forks source link

[Android] Invariant Violation: "this.props" should not be accessed during state updates #32

Closed stonehiy closed 4 days ago

stonehiy commented 4 months ago

Verson info: "react-native": "0.71.3", "react-native-timer-picker": "^1.10.1",

When using TimePicker, a quick swipe will result in the following exception:

Invariant Violation: "this.props" should not be accessed during state updates

This error is located at:
in VirtualizedList
in FlatList
in RCTView
in Unknown
in Unknown
in RCTView
in Unknown
in Unknown
in RCTView
in Unknown
in RCTView
in Unknown
in AnimatedComponent
in AnimatedComponentWrapper
in Unknown
in RCTView
in Unknown
in RCTView
in Unknown
in AnimatedComponent
in AnimatedComponentWrapper
in ThemeProvider
in RCTView
in Unknown
in PortalManager
in Portal.Host
in RNCSafeAreaProvider
in SafeAreaProvider
in SafeAreaProviderCompat
in PaperProvider
in App
in RCTView
in Unknown
in ChildrenWrapper
in _default
in Root
in RCTView
in Unknown
in AppContainer, js engine: hermes, stack:
troberts-28 commented 4 months ago

Hey @stonehiy,

Thanks for raising this. Will take a look ASAP and get this fixed 🙌

troberts-28 commented 3 months ago

Hey @stonehiy, can you share your code please? Struggling to recreate this error without it.

stonehiy commented 3 months ago

Hey @stonehiy, can you share your code please? Struggling to recreate this error without it.

https://github.com/stonehiy/react-native-timer-picker_demo

https://s17.aconvert.com/convert/p3r68-cdx67/1upsj-v46ol.gif

https://github.com/stonehiy/react-native-timer-picker_demo/blob/main/files/c4a1a32894088b653d6c9749dfacc0ae.mp4

troberts-28 commented 3 months ago

Hey @stonehiy, thanks for sharing the demo. I'm still not seeing that error on my end but I had a suspicion of what might be causing it.

I've safeguarded against it in the latest version (v1.10.3). Please try upgrading to that version, and let me know if the error persists 🙌

stonehiy commented 3 months ago

Hey @stonehiy, thanks for sharing the demo. I'm still not seeing that error on my end but I had a suspicion of what might be causing it.

I've safeguarded against it in the latest version (v1.10.3). Please try upgrading to that version, and let me know if the error persists 🙌

Hey @troberts-28 ,I have tried to use the lasest version(v1.10.3), but this bug isn't fixed to me.

troberts-28 commented 3 months ago

Ah ok, will have another go at recreating it and get back to you 👍

troberts-28 commented 4 days ago

Hey @stonehiy,

Sorry to only just be picking this up.

I have pinned down the problem to this React Native Issue, which was fixed in React Native v0.72.0.

I've decided not to go in and try and make the logic compatible with the versions of RN that contained this issue, so my recommendation is to upgrade you RN version to 0.72 or above.

I have increased the projects' peer dependency versions to reflect the incompatibilty.