Abhinandan-Kushwaha / react-native-gifted-charts

The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar and Population Pyramid charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.
https://www.npmjs.com/package/react-native-gifted-charts
MIT License
755 stars 151 forks source link

Type errors resulting in deployment failure #691

Closed james-cohen closed 2 months ago

james-cohen commented 3 months ago

Using this package results in type errors due to undeclared types when using tsc. We have had to turn off type checks in our CICD pipeline in order to use this package, but this has now caused bugs in our app so I want to draw attention to the issue.

I have seen that the issue has been raised multiple times and there are multiple PRs offering to resolve the issue.

Can this please be resolved ASAP?

Full error response:

node_modules/gifted-charts-core/src/utils/index.ts:1355:31 - error TS2550: Property 'findLastIndex' does not exist on type 'lineDataItem[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.

1355     const preValidIndex = pre.findLastIndex(
                                   ~~~~~~~~~~~~~

node_modules/gifted-charts-core/src/utils/index.ts:1377:40 - error TS2550: Property 'findLastIndex' does not exist on type 'lineDataItem[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.

1377       const secondPreIndex = secondPre.findLastIndex(
                                            ~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/BarChart/Animated2DWithGradient.tsx:111:17 - error TS2322: Type 'ViewStyle[] | undefined' is not assignable to type 'ViewStyle | undefined'.
  Type 'ViewStyle[]' has no properties in common with type 'ViewStyle'.

111                 style={commonStyleForBar}
                    ~~~~~

  node_modules/react-native-gifted-charts/src/Components/common/LinearGradient.tsx:6:3
    6   style?: ViewStyle;
        ~~~~~
    The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & LinearGradientProps'

node_modules/react-native-gifted-charts/src/BarChart/index.tsx:20:19 - error TS7006: Parameter 'evt' implicitly has an 'any' type.

20     onTouchStart: evt => {
                     ~~~

node_modules/react-native-gifted-charts/src/BarChart/index.tsx:145:31 - error TS7006: Parameter 'pointerLabelComponent' implicitly has an 'any' type.

145   const renderStripAndLabel = pointerLabelComponent => {
                                  ~~~~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/BarChart/index.tsx:210:35 - error TS2339: Property 'stacks' does not exist on type 'barDataItem | stackDataItem'.
  Property 'stacks' does not exist on type 'barDataItem'.

210             const stackSum = item.stacks?.reduce(
                                      ~~~~~~

node_modules/react-native-gifted-charts/src/BarChart/index.tsx:211:16 - error TS7006: Parameter 'acc' implicitly has an 'any' type.

211               (acc, stack) => acc + (stack.value ?? 0),
                   ~~~

node_modules/react-native-gifted-charts/src/BarChart/index.tsx:211:21 - error TS7006: Parameter 'stack' implicitly has an 'any' type.

211               (acc, stack) => acc + (stack.value ?? 0),
                        ~~~~~

node_modules/react-native-gifted-charts/src/BarChart/index.tsx:252:35 - error TS2339: Property 'stacks' does not exist on type 'barDataItem | stackDataItem'.
  Property 'stacks' does not exist on type 'barDataItem'.

252             const stackSum = item.stacks?.reduce(
                                      ~~~~~~

node_modules/react-native-gifted-charts/src/BarChart/index.tsx:253:16 - error TS7006: Parameter 'acc' implicitly has an 'any' type.

253               (acc, stack) => acc + (stack.value ?? 0),
                   ~~~

node_modules/react-native-gifted-charts/src/BarChart/index.tsx:253:21 - error TS7006: Parameter 'stack' implicitly has an 'any' type.

253               (acc, stack) => acc + (stack.value ?? 0),
                        ~~~~~

node_modules/react-native-gifted-charts/src/BarChart/RenderBars.tsx:220:11 - error TS2559: Type 'ViewStyle[]' has no properties in common with type 'ViewStyle'.

220           style={commonStyleForBar}
              ~~~~~

  node_modules/react-native-gifted-charts/src/Components/common/LinearGradient.tsx:6:3
    6   style?: ViewStyle;
        ~~~~~
    The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & LinearGradientProps'

node_modules/react-native-gifted-charts/src/BarChart/RenderBars.tsx:329:37 - error TS7006: Parameter 'noGradient' implicitly has an 'any' type.

329     const animated2DWithGradient = (noGradient, noAnimation) => (
                                        ~~~~~~~~~~

node_modules/react-native-gifted-charts/src/BarChart/RenderBars.tsx:329:49 - error TS7006: Parameter 'noAnimation' implicitly has an 'any' type.

329     const animated2DWithGradient = (noGradient, noAnimation) => (
                                                    ~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.tsx:9:30 - error TS7006: Parameter 'props' implicitly has an 'any' type.

9 const RenderLineInBarChart = props => {
                               ~~~~~

node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.tsx:8:33 - error TS7006: Parameter 'props' implicitly has an 'any' type.

8 export const renderDataPoints = props => {
                                  ~~~~~

node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.tsx:26:41 - error TS7006: Parameter 'total' implicitly has an 'any' type.

26       item.value ?? item.stacks.reduce((total, item) => total + item.value, 0);
                                           ~~~~~

node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.tsx:26:48 - error TS7006: Parameter 'item' implicitly has an 'any' type.

26       item.value ?? item.stacks.reduce((total, item) => total + item.value, 0);
                                                  ~~~~

node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.tsx:6:41 - error TS7006: Parameter 'props' implicitly has an 'any' type.

6 export const renderSpecificDataPoints = props => {
                                          ~~~~~

node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.tsx:5:44 - error TS7006: Parameter 'props' implicitly has an 'any' type.

5 export const renderSpecificVerticalLines = props => {
                                             ~~~~~

node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderVerticalLines.tsx:7:29 - error TS7006: Parameter 'props' implicitly has an 'any' type.

7 const RenderVerticalLines = props => {
                              ~~~~~

node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderVerticalLines.tsx:33:35 - error TS7006: Parameter 'index' implicitly has an 'any' type.

33   const getHeightOfVerticalLine = index => {
                                     ~~~~~

node_modules/react-native-gifted-charts/src/Components/BarSpecificComponents/barBackgroundPattern.tsx:5:30 - error TS7006: Parameter 'props' implicitly has an 'any' type.

5 const BarBackgroundPattern = props => {
                               ~~~~~

node_modules/react-native-gifted-charts/src/Components/BarSpecificComponents/cap.tsx:6:13 - error TS7006: Parameter 'props' implicitly has an 'any' type.

6 const Cap = props => {
              ~~~~~

node_modules/react-native-gifted-charts/src/Components/common/Pointer.tsx:5:24 - error TS7006: Parameter 'props' implicitly has an 'any' type.

5 export const Pointer = props => {
                         ~~~~~

node_modules/react-native-gifted-charts/src/Components/common/StripAndLabel.tsx:7:30 - error TS7006: Parameter 'props' implicitly has an 'any' type.

7 export const StripAndLabel = props => {
                               ~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:10:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

10   barDataItem,
     ~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:11:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

11   stackDataItem,
     ~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:12:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

12   BarChartPropsType,
     ~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:13:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

13   StackedBarChartPropsType,
     ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:14:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

14   pieDataItem,
     ~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:15:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

15   PieChartPropsType,
     ~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:16:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

16   lineDataItem,
     ~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:17:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

17   bicolorLineDataItem,
     ~~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:18:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

18   LineChartPropsType,
     ~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:19:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

19   LineChartBicolorPropsType,
     ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:20:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

20   popnPyramidDataItem,
     ~~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:21:3 - error TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

21   PopulationPyramidPropsType,
     ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/index.tsx:25:3 - error TS1448: 'EdgePosition' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled.

25   EdgePosition,
     ~~~~~~~~~~~~

  node_modules/gifted-charts-core/src/index.ts:133:3
    133   type EdgePosition,
          ~~~~~~~~~~~~~~~~~
    'EdgePosition' was exported here.

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:420:11 - error TS7053: Element implicitly has an 'any' type because expression of type 'number' can't be used to index type '() => void'.
  No index signature with a parameter of type 'number' was found on type '() => void'.

420           decreaseWidthsFromSet?.[index]?.();
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:558:25 - error TS7006: Parameter 'item' implicitly has an 'any' type.

558   const onStripPress = (item, index) => {
                            ~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:558:31 - error TS7006: Parameter 'index' implicitly has an 'any' type.

558   const onStripPress = (item, index) => {
                                  ~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:568:5 - error TS7006: Parameter 'hideDataPoints' implicitly has an 'any' type.

568     hideDataPoints,
        ~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:569:5 - error TS7006: Parameter 'dataForRender' implicitly has an 'any' type.

569     dataForRender,
        ~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:570:5 - error TS7006: Parameter 'originalDataFromProps' implicitly has an 'any' type.

570     originalDataFromProps,
        ~~~~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:571:5 - error TS7006: Parameter 'dataPtsShape' implicitly has an 'any' type.

571     dataPtsShape,
        ~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:572:5 - error TS7006: Parameter 'dataPtsWidth' implicitly has an 'any' type.

572     dataPtsWidth,
        ~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:573:5 - error TS7006: Parameter 'dataPtsHeight' implicitly has an 'any' type.

573     dataPtsHeight,
        ~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:574:5 - error TS7006: Parameter 'dataPtsColor' implicitly has an 'any' type.

574     dataPtsColor,
        ~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:575:5 - error TS7006: Parameter 'dataPtsRadius' implicitly has an 'any' type.

575     dataPtsRadius,
        ~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:576:5 - error TS7006: Parameter 'textColor' implicitly has an 'any' type.

576     textColor,
        ~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:577:5 - error TS7006: Parameter 'textFontSize' implicitly has an 'any' type.

577     textFontSize,
        ~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:578:5 - error TS7006: Parameter 'startIndex' implicitly has an 'any' type.

578     startIndex,
        ~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:579:5 - error TS7006: Parameter 'endIndex' implicitly has an 'any' type.

579     endIndex,
        ~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:580:5 - error TS7006: Parameter 'isSecondary' implicitly has an 'any' type.

580     isSecondary,
        ~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:581:5 - error TS7006: Parameter 'showValuesAsDataPointsText' implicitly has an 'any' type.

581     showValuesAsDataPointsText,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:870:28 - error TS7053: Element implicitly has an 'any' type because expression of type 'number' can't be used to index type 'DataSet'.
  No index signature with a parameter of type 'number' was found on type 'DataSet'.

870         pointerItemLocal = set[pIndex];
                               ~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:935:22 - error TS18048: 'pointerYLocal' is possibly 'undefined'.

935       pointerYLocal: pointerYLocal + xAxisThickness,
                         ~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1055:5 - error TS7006: Parameter 'arrowPoints' implicitly has an 'any' type.

1055     arrowPoints,
         ~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1056:5 - error TS7006: Parameter 'arrowStrokeWidth' implicitly has an 'any' type.

1056     arrowStrokeWidth,
         ~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1057:5 - error TS7006: Parameter 'arrowStrokeColor' implicitly has an 'any' type.

1057     arrowStrokeColor,
         ~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1058:5 - error TS7006: Parameter 'arrowFillColor' implicitly has an 'any' type.

1058     arrowFillColor,
         ~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1059:5 - error TS7006: Parameter 'key' implicitly has an 'any' type.

1059     key,
         ~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1297:28 - error TS7006: Parameter 'x' implicitly has an 'any' type.

1297   const activatePointers = x => {
                                ~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1375:33 - error TS2345: Argument of type 'lineDataItem | barDataItem' is not assignable to parameter of type 'SetStateAction<undefined>'.
  Type 'lineDataItem' is not assignable to type 'SetStateAction<undefined>'.
    Type 'lineDataItem' provides no match for the signature '(prevState: undefined): undefined'.

1375         setSecondaryPointerItem(item);
                                     ~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1405:5 - error TS7006: Parameter 'showArrow' implicitly has an 'any' type.

1405     showArrow,
         ~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1406:5 - error TS7006: Parameter 'arrowPoints' implicitly has an 'any' type.

1406     arrowPoints,
         ~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1407:5 - error TS7006: Parameter 'arrowStrokeWidth' implicitly has an 'any' type.

1407     arrowStrokeWidth,
         ~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1408:5 - error TS7006: Parameter 'arrowStrokeColor' implicitly has an 'any' type.

1408     arrowStrokeColor,
         ~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1409:5 - error TS7006: Parameter 'arrowFillColor' implicitly has an 'any' type.

1409     arrowFillColor,
         ~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1518:39 - error TS2345: Argument of type 'lineDataItem | barDataItem' is not assignable to parameter of type 'SetStateAction<undefined>'.

1518               setSecondaryPointerItem(item);
                                           ~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1604:5 - error TS7006: Parameter 'showArrow' implicitly has an 'any' type.

1604     showArrow,
         ~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1605:5 - error TS7006: Parameter 'arrowPoints' implicitly has an 'any' type.

1605     arrowPoints,
         ~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1606:5 - error TS7006: Parameter 'arrowStrokeWidth' implicitly has an 'any' type.

1606     arrowStrokeWidth,
         ~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1607:5 - error TS7006: Parameter 'arrowStrokeColor' implicitly has an 'any' type.

1607     arrowStrokeColor,
         ~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1608:5 - error TS7006: Parameter 'arrowFillColor' implicitly has an 'any' type.

1608     arrowFillColor,
         ~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/index.tsx:1718:39 - error TS2345: Argument of type 'lineDataItem | barDataItem' is not assignable to parameter of type 'SetStateAction<undefined>'.

1718               setSecondaryPointerItem(item);
                                           ~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:195:25 - error TS7006: Parameter 'item' implicitly has an 'any' type.

195   const onStripPress = (item, index) => {
                            ~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:195:31 - error TS7006: Parameter 'index' implicitly has an 'any' type.

195   const onStripPress = (item, index) => {
                                  ~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:203:5 - error TS7006: Parameter 'dataForRender' implicitly has an 'any' type.

203     dataForRender,
        ~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:204:5 - error TS7006: Parameter 'dataPtsShape' implicitly has an 'any' type.

204     dataPtsShape,
        ~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:205:5 - error TS7006: Parameter 'dataPtsWidth' implicitly has an 'any' type.

205     dataPtsWidth,
        ~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:206:5 - error TS7006: Parameter 'dataPtsHeight' implicitly has an 'any' type.

206     dataPtsHeight,
        ~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:207:5 - error TS7006: Parameter 'dataPtsColor' implicitly has an 'any' type.

207     dataPtsColor,
        ~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:208:5 - error TS7006: Parameter 'dataPtsRadius' implicitly has an 'any' type.

208     dataPtsRadius,
        ~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:209:5 - error TS7006: Parameter 'textColor' implicitly has an 'any' type.

209     textColor,
        ~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:210:5 - error TS7006: Parameter 'textFontSize' implicitly has an 'any' type.

210     textFontSize,
        ~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:211:5 - error TS7006: Parameter 'startIndex' implicitly has an 'any' type.

211     startIndex,
        ~~~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:212:5 - error TS7006: Parameter 'endIndex' implicitly has an 'any' type.

212     endIndex,
        ~~~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:500:30 - error TS7006: Parameter 'points' implicitly has an 'any' type.

500           ? pointsArray.map((points, index) => (
                                 ~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:500:38 - error TS7006: Parameter 'index' implicitly has an 'any' type.

500           ? pointsArray.map((points, index) => (
                                         ~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:510:30 - error TS7006: Parameter 'points' implicitly has an 'any' type.

510           : pointsArray.map((points, index) => {
                                 ~~~~~~

node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:510:38 - error TS7006: Parameter 'index' implicitly has an 'any' type.

510           : pointsArray.map((points, index) => {
                                         ~~~~~

node_modules/react-native-gifted-charts/src/PieChart/index.tsx:33:30 - error TS7006: Parameter 'innerRadius' implicitly has an 'any' type.

33   const renderInnerCircle = (innerRadius, innerCircleBorderWidth) => {
                                ~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/PieChart/index.tsx:33:43 - error TS7006: Parameter 'innerCircleBorderWidth' implicitly has an 'any' type.

33   const renderInnerCircle = (innerRadius, innerCircleBorderWidth) => {
                                             ~~~~~~~~~~~~~~~~~~~~~~

node_modules/react-native-gifted-charts/src/PieChart/index.tsx:144:34 - error TS2304: Cannot find name 'alert'.

144                   onPress: () => alert('black'),
                                     ~~~~~

Found 96 errors in 17 files.

Errors  Files
     2  node_modules/gifted-charts-core/src/utils/index.ts:1355
     1  node_modules/react-native-gifted-charts/src/BarChart/Animated2DWithGradient.tsx:111
     8  node_modules/react-native-gifted-charts/src/BarChart/index.tsx:20
     3  node_modules/react-native-gifted-charts/src/BarChart/RenderBars.tsx:220
     1  node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.tsx:9
     3  node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.tsx:8
     1  node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.tsx:6
     1  node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.tsx:5
     2  node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderVerticalLines.tsx:7
     1  node_modules/react-native-gifted-charts/src/Components/BarSpecificComponents/barBackgroundPattern.tsx:5
     1  node_modules/react-native-gifted-charts/src/Components/BarSpecificComponents/cap.tsx:6
     1  node_modules/react-native-gifted-charts/src/Components/common/Pointer.tsx:5
     1  node_modules/react-native-gifted-charts/src/Components/common/StripAndLabel.tsx:7
    13  node_modules/react-native-gifted-charts/src/index.tsx:10
    38  node_modules/react-native-gifted-charts/src/LineChart/index.tsx:420
    16  node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:195
     3  node_modules/react-native-gifted-charts/src/PieChart/index.tsx:33
Abhinandan-Kushwaha commented 3 months ago

Hi @james-cohen I will be merging the pending PRs this week, and will also try to release a new version of the library with fully typed code. Sorry for such long delay.

pinuts-SebastianGolbert commented 3 months ago

Hi @Abhinandan-Kushwaha ,

thanks for the great library! I'm also waiting for the update 🙏

Abhinandan-Kushwaha commented 2 months ago

Hi @james-cohen @pinuts-SebastianGolbert react-native-gifted-charts is now shipping compiled js files instead of ts files from version 1.4.22 onwards. This should fix all type related issues. 🎉

pinuts-SebastianGolbert commented 2 months ago

@Abhinandan-Kushwaha Thank you for the fix! If I'm not mistaken, gifted-charts-core also needs a similar fix.

pinuts-SebastianGolbert commented 2 months ago

I forgot to mention that I have been using a workaround for these issues:

// TODO: Change to module import when the next library release is available
const giftedCharts = require('react-native-gifted-charts');
const PieChart = giftedCharts.PieChart;

Together with a declaration of the library as empty module

// TODO: Delete when when the next library release is available
declare module 'react-native-gifted-charts';
stereodenis commented 2 months ago

created an issue https://github.com/Abhinandan-Kushwaha/gifted-charts-core/issues/31

Abhinandan-Kushwaha commented 2 months ago

Hi @stereodenis Thanks for reporting this issue.

It has been fixed with this PR- https://github.com/Abhinandan-Kushwaha/gifted-charts-core/pull/33