Getting Super expression must either be null or a function in React Native App

572 Views Asked by At

I am getting the following error: Super expression must either be null or a function.

It is saying that the error in my PieChart.js Mainly it is stating the problem is in import statement from victory-native (https://i.stack.imgur.com/x2WiN.jpg).

"dependencies": {
    "expo": "~42.0.1",
    "expo-status-bar": "~1.0.4",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "~3.4.0",
    "react-native-svg": "^12.1.1",
    "react-native-svg-animated-linear-gradient": "^0.4.0",
    "react-native-svg-charts": "^5.4.0",
    "react-native-web": "~0.13.12",
    "victory-native": "^35.3.3"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0"
  },

Import statements in PieChart.js:

import React from "react";
import { StyleSheet, View } from "react-native";
import { VictoryLegend, VictoryPie } from "victory-native";
 
import colors from "../config/colors";
1

There are 1 best solutions below

3
On

I have the same issue, you can work around it using yarn resolutions to go back to 35.10.0. They broke it in 35.11.0

"resolutions": {
    "victory": "35.10.0",
    "victory-area": "35.10.0",
    "victory-axis": "35.10.0",
    "victory-bar": "35.10.0",
    "victory-box-plot": "35.10.0",
    "victory-brush-container": "35.10.0",
    "victory-brush-line": "35.10.0",
    "victory-candlestick": "35.10.0",
    "victory-chart": "35.10.0",
    "victory-core": "35.10.0",
    "victory-create-container": "35.10.0",
    "victory-cursor-container": "35.10.0",
    "victory-errorbar": "35.10.0",
    "victory-group": "35.10.0",
    "victory-histogram": "35.10.0",
    "victory-legend": "35.10.0",
    "victory-line": "35.10.0",
    "victory-pie": "35.10.0",
    "victory-polar-axis": "35.10.0",
    "victory-scatter": "35.10.0",
    "victory-selection-container": "35.10.0",
    "victory-shared-events": "35.10.0",
    "victory-stack": "35.10.0",
    "victory-tooltip": "35.10.0",
    "victory-voronoi": "35.10.0",
    "victory-voronoi-container": "35.10.0",
    "victory-zoom-container": "35.10.0"
  },