react-native-charts-wrapper
Version:
A react-native charts support both android and iOS.
15 lines (13 loc) • 458 B
JavaScript
import React, {Component} from 'react';
import { UIManager, findNodeHandle} from 'react-native';
export default function ScrollEnhancer(Chart) {
return class ScrollExtended extends Chart {
setDataAndLockIndex(data) {
UIManager.dispatchViewManagerCommand(
findNodeHandle(this.getNativeComponentRef()),
UIManager.getViewManagerConfig(this.getNativeComponentName()).Commands.setDataAndLockIndex,
[data]
);
}
}
}