fix: restore compatibility with react-native <0.68 (#1890) (#1891)

Replaces PointerEvents.parsePointerEvents(pointerEventsStr) with PointerEvents.valueOf(pointerEventsStr.toUpperCase(Locale.US).replace("-", "_")). This is the implementation of the original method.
This commit is contained in:
Jasper Reddin
2022-10-10 05:15:39 -05:00
committed by GitHub
parent f49728d783
commit 4aba67cea7

View File

@@ -21,6 +21,7 @@ import com.facebook.react.views.view.ReactViewGroup;
import com.facebook.react.views.view.ReactViewManager;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Locale;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -174,7 +175,8 @@ class SvgViewManager extends ReactViewManager implements RNSVGSvgViewManagerInte
if (superclass != null) {
Method method = superclass.getDeclaredMethod("setPointerEvents", PointerEvents.class);
method.setAccessible(true);
method.invoke(view, PointerEvents.parsePointerEvents(pointerEventsStr));
method.invoke(
view, PointerEvents.valueOf(pointerEventsStr.toUpperCase(Locale.US).replace("-", "_")));
}
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
e.printStackTrace();