Upgrade rn#14
Open
oleksandrkaDev wants to merge 16 commits into
Open
Conversation
There was a problem hiding this comment.
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
Iconexport.
export { default as BarChart } from './src/BarChart/BarChart'
src/LineChart/LineChart.js:179
- Ensure that
d.indexis always defined in this callback context; if VictoryLabel’s props change, this could throw. Consider adding a safeguard likeconst idx = d.index ?? 0or validating the presence ofd.indexbefore use.
if (data[d.index].x.length > 11 - 2 * (data.length - 3)) {
| "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", |
There was a problem hiding this comment.
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", |
danicunhac
reviewed
Jul 7, 2025
danicunhac
reviewed
Jul 7, 2025
danicunhac
approved these changes
Jul 7, 2025
danicunhac
approved these changes
Jul 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The old version of the component does not work with the new version of React Native
Solution
Upgrade fallen libs