react-native-gesture-handler: fails with react-native-windows, cannot read property Direction of undefined

Hello, Excellent work by the team.

Please forgive me if my issue is not clear enough or does not follow the standard. I will provide further information if need be. Thanks in advance.

Here is my problem, I am running into this error message while trying out react-native-windows on a project.

I followed the instructions on the react navigation webiste to get this installed on a bare react native project. All works well for android, but whenever I run npx react-native run-windows on windows, I get the following error message:

TypeError: Cannot read property 'Direction' of undefined

Project dependencies

"react": "16.11.0",
  "react-native": "0.62.0-0",
    "react-native-gesture-handler": "1.6.1",
    "react-native-reanimated": "1.9.0",
    "react-native-rss-parser": "1.4.0",
    "react-native-safe-area-context": "3.0.2",
    "react-native-screens": "2.8.0",
    "react-native-sqlite-2": "3.0.1",
    "react-native-webview": "10.2.3",
    "react-native-windows": "0.62.0-0"

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 18

Most upvoted comments

Having the same isssue. Its problematic as this package is part of react-navigation. 😦

The above recommendation works… but still there are few more things to fix. Here is my setup all together.

"dependencies": {
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "5.5.1",
    "@react-native-community/toolbar-android": "^0.1.0-rc.2",   
    "prop-types": "^15.7.2",
    "react": "16.11.0",
    "react-native": "^0.62.0-0",
    "react-native-gesture-handler": "1.3.0",
    "react-native-reanimated": "^1.13.0",
    "react-native-safe-area-context": "^3.1.8",
    "react-native-screens": "^2.11.0",
    "react-native-vector-icons": "^7.1.0",
    "react-native-windows": "^0.62.0-0",
    "react-navigation": "3.5.1"
  },
  • update all four files mentioned above @Hawiie13
  • Also updated react-native-safe-area-view -> index.web.js to index.windows.js.
  • Also remove lines for ToolbarAndroid from react-native-gesture-handler -> GestureComponents.windows.js