This synthetic event is reused for performance reasons
See original GitHub issueERROR Warning: This synthetic event is reused for performance reasons. If you’re seeing this, you’re accessing the property nativeEvent
on a released/nullified synthetic event. This is set to null. If you must keep the original synthetic event around, use event.persist(). See https://reactjs.org/link/event-pooling for more information.
WARN Possible Unhandled Promise Rejection (id: 0):
TypeError: null is not an object (evaluating ‘_ref2.nativeEvent.layout’)
Reproduce
<Modalize
modalHeight={600}
alwaysOpen={130}
withHandle
modalStyle={homeModalizeStyles.modalStyle}
HeaderComponent={position === 'initial' ? <HomeFooter /> : <HomeHeader />}
FooterComponent={position === 'top' && <HomeFooter />}
handleStyle={homeModalizeStyles.handleStyle}
childrenStyle={homeModalizeStyles.childrenStyle}
onPositionChange={setPosition}
panGestureComponentEnabled
flatListProps={{
data: menu,
keyExtractor: (item) => item.key,
showsVerticalScrollIndicator: false,
numColumns: 3,
renderItem: ({item}) => {
return (
<View style={homeModalizeStyles.alignCenter}>
<TouchableWithoutFeedback onPress={item.onPress}>
<View style={homeModalizeStyles.iconRounded}>
{item.isIcon ? (
<Icon name={item.icon} size={16} color={colors.black} />
) : (
<MaterialCommunityIcons name={item.icon} color={colors.black} size={18} />
)}
</View>
</TouchableWithoutFeedback>
<View style={homeModalizeStyles.labelContainer}>
<Text style={homeModalizeStyles.label}>{item.title}</Text>
<Text style={homeModalizeStyles.label}>{item.subTitle}</Text>
</View>
</View>
)
},
}}
/>
Dependencies:
- react-native-modalize 2.1.1
- react-native 0.70.1
- react-native-gesture-handler ^2.6.1
- react-native-navigation: not using
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:20
Top Results From Across the Web
Warning: This synthetic event is reused for performance ...
This is what React documentation says about it: "The SyntheticEvent is pooled. This means that the SyntheticEvent object will be reused and all ......
Read more >How to solve React's "This synthetic event is reused ... - akoskm
Warning: This synthetic event is reused for performance reasons. If you see this, you're accessing the property target on a ...
Read more >event.persist() should be called when using React synthetic ...
React uses the SyntheticEvent objects to wrap native events. For performance reasons, synthetic events are pooled and reused across multiple ...
Read more >React SyntheticEvent reuse - Medium
For performance reasons, React reuses the SyntheticEvent objects by pooling them. This means that the SyntheticEvent object is reused, ...
Read more >This synthetic event is reused for performance reasons React ...
Coding example for the question Warning: This synthetic event is reused for performance reasons React-Reactjs.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m having the same problem after updating to
0.70.1
.Hi, We are using the following patch in our project while it’s getting fixed. It persists the original event before the LayoutAnimation occurs. It’s far from perfect but works for us.