Skip to content

Upgrade rn#14

Open
oleksandrkaDev wants to merge 16 commits into
mainfrom
upgrade-rn
Open

Upgrade rn#14
oleksandrkaDev wants to merge 16 commits into
mainfrom
upgrade-rn

Conversation

@oleksandrkaDev

Copy link
Copy Markdown

Problem

The old version of the component does not work with the new version of React Native

Solution

Upgrade fallen libs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades library versions for React Native compatibility and refactors chart components to align with strict equality checks and correct tick placement logic.

  • Replace == with === in color conversion and axis formatting logic
  • Fix incorrect index usage (data[d - 1]data[d.index]) in tick label placement
  • Bump package versions and update dependencies in package.json
  • Remove outdated commented export from index.js

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/PieChart/PieChart.js Switched == to === in hexToHSL and rgbaToHex helper functions
src/LineChart/LineChart.js Updated strict comparisons; corrected data index reference in callbacks
src/BarChart/BarChart.js Same as LineChart: strict comparisons and d.index fixes
package.json Bumped component version, updated devDependencies & dependencies
index.js Removed an outdated commented export
Comments suppressed due to low confidence (3)

src/BarChart/BarChart.js:170

  • This new placement logic for variable-length labels would benefit from a unit or snapshot test to cover edge cases (e.g., data lengths of 2, long labels) and prevent regressions.
                    if (data[d.index].x.length > 11 - 2 * (data.length - 3)) {

index.js:1

  • [nitpick] This commented export is outdated and may confuse readers. Consider removing it or adding a TODO if you intend to reintroduce the Icon export.
export { default as BarChart } from './src/BarChart/BarChart'

src/LineChart/LineChart.js:179

  • Ensure that d.index is always defined in this callback context; if VictoryLabel’s props change, this could throw. Consider adding a safeguard like const idx = d.index ?? 0 or validating the presence of d.index before use.
                    if (data[d.index].x.length > 11 - 2 * (data.length - 3)) {

Comment thread src/PieChart/PieChart.js Outdated
Comment thread package.json
"react-native-svg": "9.13.3",
"rfdc": "^1.3.0",
"victory-native": "^32.0.2"
"@adalo/react-native-chart-kit": "https://github.com/AdaloHQ/react-native-chart-kit.git#upgrade-rn",

Copilot AI Jul 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinning a dependency to a git branch can lead to non-reproducible builds. Consider using a published version or tag instead of #upgrade-rn.

Suggested change
"@adalo/react-native-chart-kit": "https://github.com/AdaloHQ/react-native-chart-kit.git#upgrade-rn",
"@adalo/react-native-chart-kit": "https://github.com/AdaloHQ/react-native-chart-kit.git#v1.2.3",

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
Comment thread src/BarChart/BarChart.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants