Adding react-d3 to my react-native app causes a error

1.2k Views Asked by At

I am quite new to reactJS, and have just started working with react-native.

I added react-d3 using npm install --save-dev react-d3 but when I refresh or rebuild the app I am getting:

TypeError: undefined is not an object
(evaluating 
'require('BatchedBridge').flushedQueue')

{
 "line":1 ,
 "column": 25
}

If I remove or uninstall react-d3 from the library it works fine.

Thanks

1

There are 1 best solutions below

1
On

D3JS requires browser DOM, which React Native doesn't directly have.

The only way to possibly do this is to use a WebView to wrap the D3JS view.

It could get pretty messy, but it is doable.