diff --git a/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h b/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h index 6659e9d7104..c3ebe5608ee 100644 --- a/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +++ b/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -116,7 +117,7 @@ inline void fromRawValue( result = {}; - react_native_assert(value.hasType>()); + react_native_expect(value.hasType>()); if (value.hasType>()) { auto items = (std::vector)value; for (auto &item : items) { @@ -188,7 +189,8 @@ inline void fromRawValue( const PropsParserContext &context, const RawValue &value, ImportantForAccessibility &result) { - react_native_assert(value.hasType()); + result = ImportantForAccessibility::Auto; + react_native_expect(value.hasType()); if (value.hasType()) { auto string = (std::string)value; if (string == "auto") { @@ -201,7 +203,7 @@ inline void fromRawValue( result = ImportantForAccessibility::NoHideDescendants; } else { LOG(ERROR) << "Unsupported ImportantForAccessiblity value: " << string; - react_native_assert(false); + react_native_expect(false); } } else { LOG(ERROR) << "Unsupported ImportantForAccessiblity type"; @@ -278,7 +280,8 @@ inline void fromRawValue( const PropsParserContext &context, const RawValue &value, AccessibilityLiveRegion &result) { - react_native_assert(value.hasType()); + result = AccessibilityLiveRegion::None; + react_native_expect(value.hasType()); if (value.hasType()) { auto string = (std::string)value; if (string == "none") { @@ -289,7 +292,7 @@ inline void fromRawValue( result = AccessibilityLiveRegion::Assertive; } else { LOG(ERROR) << "Unsupported AccessibilityLiveRegion value: " << string; - react_native_assert(false); + react_native_expect(false); } } else { LOG(ERROR) << "Unsupported AccessibilityLiveRegion type";