react-native-timer-picker icon indicating copy to clipboard operation
react-native-timer-picker copied to clipboard

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

Open stonehiy opened this issue 1 year ago • 6 comments

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:

stonehiy avatar Jul 24 '24 08:07 stonehiy

Hey @stonehiy,

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

troberts-28 avatar Jul 24 '24 08:07 troberts-28

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

troberts-28 avatar Jul 30 '24 09:07 troberts-28

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

stonehiy avatar Aug 03 '24 08:08 stonehiy

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 🙌

troberts-28 avatar Aug 04 '24 12:08 troberts-28

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.

stonehiy avatar Aug 05 '24 07:08 stonehiy

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

troberts-28 avatar Aug 05 '24 16:08 troberts-28

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.

troberts-28 avatar Nov 18 '24 11:11 troberts-28