Skip to content

Conversation

bohdanprog
Copy link
Contributor

@bohdanprog bohdanprog commented Jul 26, 2025

Summary

Fixes: #2671

Previously, the issue was that when the parent ’s width is changed at runtime (via useState or other dynamic styling), the | inside an with width="100%" does not redraw to fill the new width. Instead, it remains at the width it had when first mounted.

This commit adds layout tracking via _lastBounds and triggers a recursive invalidation of all RNSVGNode subviews during layoutSubviews only when the bounds change.

Test Plan

You can easily test that solution by running the Test2671

Compatibility

OS Implemented
iOS

Checklist

  • I have tested this on a device and a simulator
  • I added documentation in README.md
  • I updated the typed files (typescript)
  • I added a test for the API in the __tests__ folder

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.

Svg width does not update when parent View’s width changes dynamically

1 participant