skip to Main Content

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

  1. Reinstalling React navigation, drawer nothing changes

Here the screenshot:

enter image description here

3

Answers


  1. Use pointerEvents property on the tag element instead of CSS stylesheet

      <View style={styles.pressable} pointerEvents={'none'}> 
        your content
      </View>
    
    Login or Signup to reply.
  2. 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 changing Drawer.tsx file.

    Also you can double check your navigation components. Maybe one of your components returned null or doesn’t have default export.

    Login or Signup to reply.
  3. I had the same problem. To not stay block, I open the file and commented the line with pointerEvents.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search