chore: Remove dead SVG Polygon/Polyline web points conversion and label examples as not supported on web#9690
Merged
Merged
Conversation
Polygon/Polyline point animations don't run on web: react-native-svg renders them as native <polygon>/<polyline>, where CSS can't animate `points` (the points->d workaround only takes effect on <path>). The "Same Number of Points" sections were unlabeled, implying web support; mark them iOS/Android only with a short note, matching the already-labeled "Different Number of Points" sections.
react-native-svg renders Polygon/Polyline as native <polygon>/<polyline> on web, where CSS can't animate `points`, so aliasing `points` to a `d` path() keyframe never had any visible effect. Drop the polygon/polyline web configs and the `pointsToPathD` processor, and register both components via the shared common config (their appearance props still animate, like Line/Pattern/Text). Update the affected tests to assert Path's `d` path() wrapping instead.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes web-specific SVG Polygon/Polyline points processing that had no visible effect on web (since react-native-svg renders them as native <polygon>/<polyline> and CSS can’t animate points), and updates examples to clearly indicate platform support.
Changes:
- Removed the
pointsToPathDprocessor and the Polygon/Polyline web property configs, and stopped exporting them from the SVG web module. - Updated SVG CSS support initialization to register
Polygon/Polylinevia the shared common config (appearance-only animation support on web). - Updated web CSS manager/parser tests and labeled the “Same Number of Points” Polygon/Polyline examples as iOS/Android-only with an explanatory note.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-reanimated/src/css/web/managers/tests/CSSPseudoSelectorsManager.test.ts | Updates SVG pseudo-selector test to validate Path d wrapping via the SVG props builder. |
| packages/react-native-reanimated/src/css/web/managers/tests/CSSAnimationsManager.web.test.ts | Updates SVG animation manager test to use Path d wrapping instead of Polygon points conversion. |
| packages/react-native-reanimated/src/css/web/tests/animationParser.test.ts | Removes Polygon points→d keyframe test and associated builder registration. |
| packages/react-native-reanimated/src/css/svg/web/processors/polyPoints.ts | Deletes dead Polygon/Polyline points conversion helper. |
| packages/react-native-reanimated/src/css/svg/web/processors/index.ts | Stops exporting removed polyPoints processor. |
| packages/react-native-reanimated/src/css/svg/web/processors/tests/polyPoints.test.ts | Deletes tests for removed pointsToPathD. |
| packages/react-native-reanimated/src/css/svg/web/index.ts | Stops exporting removed Polygon/Polyline configs. |
| packages/react-native-reanimated/src/css/svg/web/configs/polyline.ts | Deletes Polyline web config that aliased points to d. |
| packages/react-native-reanimated/src/css/svg/web/configs/polygon.ts | Deletes Polygon web config that aliased points to d. |
| packages/react-native-reanimated/src/css/svg/init.web.ts | Registers Polygon/Polyline under the shared common config (appearance-only on web). |
| apps/common-app/src/apps/css/examples/animations/screens/animatedProperties/svg/Polyline.tsx | Adds web limitation note and iOS/Android labels for “Same Number of Points” section. |
| apps/common-app/src/apps/css/examples/animations/screens/animatedProperties/svg/Polygon.tsx | Adds web limitation note and iOS/Android labels for “Same Number of Points” section. |
Comments suppressed due to low confidence (1)
packages/react-native-reanimated/src/css/web/tests/animationParser.test.ts:28
- If
Pathis renamed to a test-only component name (to avoid leaking into the global SVG props builder registry), the componentName passed intoprocessKeyframeDefinitionsshould match the registration.
test('pads a trailing Z so an open->closed path morph interpolates', () => {
const result = processKeyframeDefinitions(
{ from: { d: 'M0,0 L10,10' }, to: { d: 'M0,0 L20,5 Z' } },
'Path'
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wisniewskij
approved these changes
Jun 17, 2026
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.
Polygon and Polyline point animations don't run on web.
react-native-svgrenders them as native<polygon>/<polyline>, where CSS can't animatepoints(thepointstodpath()conversion only takes effect on<path>), so it never had any visible effect.This PR:
pointsToPathDprocessor and the Polygon/Polyline web configs, registering both via the shared common config (their appearance props still animate on web, like Line/Pattern/Text).Docs counterpart: #9682