0

I am trying to implement highcharts wrapper within react-native application following this

https://www.highcharts.com/blog/post/creating-mobile-charts-with-highcharts-react-native/

On running the app with expo start on device, it returned me below error

Warning: %s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI., RootErrorBoundary ReferenceError: Can't find variable: modules * App.js:21:8 in render

Line 21 of App.js have the highcharts container HighchartsReactNative

Any leads will be highly helpful

Salman Zafar
  • 3,844
  • 5
  • 20
  • 43
Durga Prasad
  • 121
  • 1
  • 4
  • 13

1 Answers1

0

You should declare modules as array.

const modules = [
    'highcharts-more',
    'solid-gauge'
];

You can find more info in our docs (Readme.md) here: - https://github.com/highcharts/highcharts-react-native

Sebastian Bochan
  • 37,348
  • 3
  • 49
  • 75
  • Thanks for the response Sebastian. My render method does not have modules and I noticed the error: bundling failed: Error: Unable to resolve module `@highcharts/HighchartsReactNative` from `...`: Module `@highcharts/HighchartsReactNative` does not exist in the Haste module map So I changed the import to import HighchartsReactNative from '@highcharts/highcharts-react-native'; – Durga Prasad Sep 28 '19 at 04:55
  • Now on Android emulator I see html page with
    – Durga Prasad Sep 28 '19 at 05:03
  • Im working on solution with this problem still. https://github.com/highcharts/highcharts-react-native/issues/4#issuecomment-536165094 – Sebastian Bochan Sep 30 '19 at 10:08
  • Thanks for the update hope you find the solution early. – Durga Prasad Sep 30 '19 at 11:53
  • Please stay on track with github thread. There are a beta version of new wrapper. Lets keep all feedback there, it will allow me to prepare a better solution ;) – Sebastian Bochan Oct 02 '19 at 09:23