coinjar / react-native-wagmi-charts

A sweet & simple chart library for React Native that will make us feel like We're All Gonna Make It.
MIT License
588 stars 116 forks source link

Render Error LongPressGestureHandler #158

Open Dimanokus opened 1 year ago

Dimanokus commented 1 year ago

Hi? when i add in my chart i have error LongPressGestureHandler must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/ /react-native-gesture-handler/docs/installation for more details.

My code:

<CandlestickChart.Provider data={[
        {
          timestamp: 1625945400000,
          open: 33575.25,
          high: 33600.52,
          low: 33475.12,
          close: 33520.11,
        },
        {
          timestamp: 1625946300000,
          open: 33545.25,
          high: 33560.52,
          low: 33510.12,
          close: 33520.11,
        },
        {
          timestamp: 1625947200000,
          open: 33510.25,
          high: 33515.52,
          low: 33250.12,
          close: 33250.11,
        },
        {
          timestamp: 1625948100000,
          open: 33215.25,
          high: 33430.52,
          low: 33215.12,
          close: 33420.11,
        },
      ]}>
        <CandlestickChart>
          <CandlestickChart.Candles />
          <CandlestickChart.Crosshair />
        </CandlestickChart>
      </CandlestickChart.Provider>

My packages:

"dependencies": {
    "@react-native-async-storage/async-storage": "^1.18.1",
    "@react-navigation/native": "^6.1.6",
    "@react-navigation/native-stack": "^6.9.12",
    "axios": "^1.4.0",
    "formik": "^2.2.9",
    "i18next": "^22.4.15",
    "metro-config": "^0.76.4",
    "nice-try": "^3.0.1",
    "react": "18.2.0",
    "react-i18next": "^12.2.2",
    "react-native": "0.71.8",
    "react-native-bouncy-checkbox": "^3.0.7",
    "react-native-calendars": "^1.1300.0",
    "react-native-charts-wrapper": "^0.5.11",
    "react-native-device-info": "^10.8.0",
    "react-native-element-dropdown": "^2.9.0",
    "react-native-gesture-handler": "^2.12.1",
    "react-native-gifted-charts": "^1.3.2",
    "react-native-haptic-feedback": "^2.0.3",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.8.2",
    "react-native-marquee-view": "^1.0.5",
    "react-native-popup-menu": "^0.16.1",
    "react-native-reanimated": "^3.4.2",
    "react-native-restart": "^0.0.27",
    "react-native-root-toast": "^3.4.1",
    "react-native-safe-area-context": "^4.5.2",
    "react-native-screens": "^3.20.0",
    "react-native-svg": "^13.12.0",
    "react-native-svg-transformer": "^1.0.0",
    "react-native-wagmi-charts": "^2.3.0",
    "victory-native": "^36.6.11",
    "yup": "^1.1.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native-community/eslint-config": "^3.2.0",
    "@tsconfig/react-native": "^2.0.2",
    "@types/jest": "^29.2.1",
    "@types/react": "^18.0.24",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.2.1",
    "eslint": "^8.19.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "0.73.9",
    "prettier": "^2.4.1",
    "react-test-renderer": "18.2.0",
    "typescript": "4.8.4"
  },
  "jest": {
    "preset": "react-native"
  }
flespindola commented 1 year ago

have you tried wrapper your <CandlestickChart.Provider> with <GestureHandlerRootView> ?