Repository navigation
fix: reuse initial path on mobile charts - #837
Merged
Merged
Conversation
Collaborator
✅ Heimdall Review Status
✅
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
✅
1/1
|
Denominator calculation
|
| // Re-renders must not re-parse SVG; lazy useState seeds useSharedValue on mount only. | ||
| const [initialSkiaPath] = useState( | ||
| () => Skia.Path.MakeFromSVGString(initialPath ?? currentPath) ?? Skia.Path.Make(), | ||
| ); |
Contributor
There was a problem hiding this comment.
can we declare it as a ref?
Contributor
Author
There was a problem hiding this comment.
@adrienzheng-cb we could, we'd need to do something like
const initialSkiaPathRef = useRef(null); // not sure what type is off the top of my header
if (initialSkiaPathRef.current === null) {
initialSkiaPathRef.current = Skia.Path.MakeFromSVGString(initialPath ?? currentPath) ?? Skia.Path.Make()
}
Since useRef doesn't support lazy loading. Would you prefer this?
Contributor
There was a problem hiding this comment.
o I see. let's keep the useState then. I was asking because I prefer refs to states, whose update methods are unused.
Contributor
Author
There was a problem hiding this comment.
Thanks for thinking about this!
adrienzheng-cb
self-requested a review
August 10, 2026 16:28
adrienzheng-cb
approved these changes
Aug 10, 2026
Contributor
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.
What changed? Why?
This PR updates our mobile charts transition to reuse initial path, based on feedback I saw in #777
ChartPerfTest.mov
Testing
Simply test that ChartTransitions work as expected
How has it been tested?
Testing instructions
Illustrations/Icons Checklist
Required if this PR changes files under
packages/illustrations/**orpackages/icons/**Change management
type=routine
risk=low
impact=sev5
automerge=false