Victory-native: Rejection (id: 0): Invariant Violation: Invariant Violation: Expected ref to be a function or a string.

Created on 1 Jan 2018  路  3Comments  路  Source: FormidableLabs/victory-native

Hi @PaitoAnderson
I meet an crash problem with the following errors:
2018-01-01 16:33:35.015 [warn][tid:com.facebook.react.JavaScript] Possible Unhandled Promise Rejection (id: 0):
Invariant Violation: Invariant Violation: Expected ref to be a function or a string.

This error is located at:
in RNSVGGroup (at G.js:20)
in G (at victory-chart.js:12)
in RNSVGSvgView (at Svg.js:80)
in Svg (at victory-container.js:13)
in VictoryContainer (at victory-chart.js:11)
in VictoryChart (at HistoryDataView.js:375)
in HistoryDataView (at History.js:80)
in RCTView (at View.js:113)
in View (at HistoryView.js:268)
in HistoryView (at History.js:127)
in History (created by Connect(History))
in Connect(History) (at Scene.js:36)
in RCTView (at View.js:113)
in View (at ContextComponent.js:29)
in ContextComponent (at Scene.js:34)
in RCTView (at View.js:113)
in View (at Navigator.js:1284)
in RCTView (at View.js:113)
in View (at Navigator.js:1357)
in RCTView (at View.js:113)
in View (at Navigator.js:1356)
in Navigator (at Scene.js:55)
in Scene (at Entry.js:235)
in Entry (created by Connect(Entry))
in Connect(Entry) (at Root.js:14)
in Provider (at Root.js:13)
in Root (at renderApplication.js:35)
in RCTView (at View.js:113)
in View (at AppContainer.js:102)
in _class (at index.js:69)
in RCTView (at View.js:113)
in View (at index.js:68)
in RootSiblingsWrapper (at AppContainer.js:120)
in RCTView (at View.js:113)
in View (at AppContainer.js:126)
in AppContainer (at renderApplication.js:34)

I am using the following dependencies, please tell us what i can do when use [email protected] with your components.

dependencies {
"react": "^16.0.0-alpha.12",
"react-native": "^0.51.0",
"victory-chart": "^24.5.0",
"victory-chart-native": "^1.3.1",
"victory-core": "^20.5.0",
"victory-core-native": "^4.0.0",
"victory-pie-native": "^1.1.1"
"react-native-svg": "6.0.0",
"react-native-svg-mock": "^2.0.0",
}

import {
VictoryAxis,
// VictoryArea,
VictoryBar,
// VictoryCandlestick,
VictoryChart,
// VictoryErrorBar,
// VictoryGroup,
VictoryLine,
VictoryScatter,
// VictoryStack
} from "victory-chart-native";

Most helpful comment

@samuelltk It looks like you are using some of our deprecated libraries, and also depending on some packages that are unnecessary for using victory-native. Your dependencies should look like

dependencies {
"react": "^16.0.0-alpha.12",
"react-native": "^0.51.0",
"react-native-svg": "6.0.1-rc.1",
"victory-native": "~0.16.2",
}

All of your native Victory* imports should come from victory-native

I'm going to close this issue, but let me know if you keep having issues.

All 3 comments

@boygirl @chrisbolin

@samuelltk It looks like you are using some of our deprecated libraries, and also depending on some packages that are unnecessary for using victory-native. Your dependencies should look like

dependencies {
"react": "^16.0.0-alpha.12",
"react-native": "^0.51.0",
"react-native-svg": "6.0.1-rc.1",
"victory-native": "~0.16.2",
}

All of your native Victory* imports should come from victory-native

I'm going to close this issue, but let me know if you keep having issues.

@boygirl Thank you very much.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

udfalkso picture udfalkso  路  4Comments

yvonne6344 picture yvonne6344  路  4Comments

ericschaal picture ericschaal  路  4Comments

ararog picture ararog  路  4Comments

ChrisGatzo picture ChrisGatzo  路  3Comments