react-gifted-charts
Version:
ReactJS counterpart of react-native-gifted-charts. An intuitive charting library for Bar, Line, Area, Pie, Donut, Stacked Bar, Population Pyramid and Radar charts in React
10 lines • 410 B
JavaScript
import { useEffect, useRef } from 'react';
export var screenWidth = 300;
export function usePrevious(value) {
var ref = useRef('');
useEffect(function () {
ref.current = value; //assign the value of ref to the argument
}, [value]); //this code will run when the value of 'value' changes
return ref.current; //in the end, return the current ref value.
}
//# sourceMappingURL=index.js.map