问题
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:
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.
来源:https://stackoverflow.com/questions/29415615/adding-react-d3-to-my-react-native-app-causes-a-error