From 7291c99d85b597f0606511e7b775b865db2cc27e Mon Sep 17 00:00:00 2001 From: parthmajmundar Date: Tue, 15 Jul 2025 13:35:29 +0530 Subject: [PATCH] fix: resolve UIManager null error by importing directly from react-native - Fixed `TypeError: Cannot read property 'setLayoutAnimationEnabledExperimental' of null` - Replaced destructuring from NativeModules with direct UIManager import - Prevents crash on Android in Hermes or NoBridge environments --- lib/AnySizeDragSortableView.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/AnySizeDragSortableView.js b/lib/AnySizeDragSortableView.js index 9450cbc..d8c8054 100644 --- a/lib/AnySizeDragSortableView.js +++ b/lib/AnySizeDragSortableView.js @@ -6,11 +6,12 @@ import { View, PanResponder, LayoutAnimation, - Platform + Platform, + UIManager } from 'react-native'; const PropTypes = require('prop-types') const ANIM_DURATION = 300 -const { UIManager } = NativeModules; +// const { UIManager } = NativeModules; if (Platform.OS === 'android') { if (UIManager.setLayoutAnimationEnabledExperimental) { @@ -511,4 +512,4 @@ const styles = StyleSheet.create({ flexDirection: 'row', flexWrap: 'wrap' } -}); \ No newline at end of file +});