You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes I get native crashes in core and third party Native UI Components.
for example:
some of the style prop validation happens in native code and сonsequently we can get run-time type mismatch error when we are using string ("1.0") when number (1.0) was expected.
Animated.interpolate inputRange should be monotonic increasing number sequence. So when its values are calculated in runtime, you can get a runtime crash if your range is not right.
other things related to props update in native code
The Core of It
I was thinking maybe it would be useful to be able to catch these native errors in componentDidCatch to hide a broken component. I know there are global error handlers for react-native, but my point only about Native UI Components errors.
thoughts about implementation
Some errors can be catched by wrapping prop update native functions into try {} catch {} before invoking. That will work only for errors in current thread and current event. So delayed and asynchronous code will cause native crash anyway.
This discussion was converted from issue #169 on June 10, 2021 08:42.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Introduction
Hello,
Sometimes I get native crashes in core and third party Native UI Components.
for example:
style
prop validation happens in native code and сonsequently we can get run-time type mismatch error when we are using string ("1.0"
) when number (1.0
) was expected.inputRange
should be monotonic increasing number sequence. So when its values are calculated in runtime, you can get a runtime crash if your range is not right.The Core of It
I was thinking maybe it would be useful to be able to catch these native errors in
componentDidCatch
to hide a broken component. I know there are global error handlers for react-native, but my point only about Native UI Components errors.thoughts about implementation
try {} catch {}
before invoking. That will work only for errors in current thread and current event. So delayed and asynchronous code will cause native crash anyway.Beta Was this translation helpful? Give feedback.
All reactions