I need to solve this error:
Invariant Violation: "pointerEvents" is not a valid style property.
StyleSheet pressable: {
"flex": 1,
"pointerEvents": "auto"
}
There is no pressable, pointerEvents if I try to find it globally. There is none of it in any file.
Another error is :
Error: Requiring module "node_modules/@react-navigation/drawer/src/views/modern/Drawer.tsx",
which threw an exception: Invariant Violation: "pointerEvents" is not a valid style property.
Things I’ve done :
1.Reinstall Mac, start from factory setting
2.Reinstall simulator
3.Creating new react-native app which is fine and shows no error like this
4.It shows stylesheet pressable , but there is no "pressable" style on stylesheet , there are <pressable></pressable>
and I changed it to <button>
, nothing changes it still shows the same error
5.Recreating the error with creating :
const styles = StyleSheet.create({
pressable : {
pointerEvents:'NONNEEEE'
}
})
it does create the same error. But still can’t find any pointerEvents class / style / components
- Reinstalling React navigation, drawer nothing changes
Here the screenshot:
3
Answers
Use pointerEvents property on the tag element instead of CSS stylesheet
For me lowering
@react-navigation/drawer
version to v6.5.0 fixed my problem.I’ve been struggling with same error for hours. Contributers released new patch few days ago
@react-navigation/drawer
v6.5.7. But I haven’t found any patch note about changingDrawer.tsx
file.Also you can double check your navigation components. Maybe one of your components returned
null
or doesn’t havedefault export
.I had the same problem. To not stay block, I open the file and commented the line with pointerEvents.