UNPKG

react-native-stonk-charts

Version:

A beautiful, performant chart library for React Native. Fork of react-native-wagmi-charts with Reanimated v4 support.

20 lines (16 loc) 550 B
import React from 'react'; import { LineChartContext } from './Context'; import { useLineChartData, useLineChartId } from './Data'; import { useCurrentY } from './useCurrentY'; export function useLineChart() { const lineChartContext = React.useContext(LineChartContext); const maybeId = useLineChartId(); const dataContext = useLineChartData({ id: maybeId, }); const currentY = useCurrentY(); return React.useMemo( () => ({ ...lineChartContext, ...dataContext, currentY }), [lineChartContext, dataContext, currentY] ); }