Skip to content

Conversation

@aleksei-ds
Copy link

/scripts/assemble.ts:
Previously, when generating icon weight maps, all SVG JSX content for icon weights was wrapped in a React fragment, even when a single top-level element was present.

This update uses JSDOM to parse the SVG content and only adds a fragment when multiple top-level children exist. The result is cleaner and more efficient output that aligns with React's expectations.

A Kudikovs added 2 commits July 12, 2025 14:44
… definition map

(/scripts/assemble.ts): Previously, when generating icon weight maps, all SVG JSX content for icon weights was wrapped in a React fragment, even when a single top-level element was present.

This update uses JSDOM to parse the SVG content and only adds a fragment when multiple top-level children exist. The result is cleaner and more efficient output that aligns with React's expectations.
@aleksei-ds aleksei-ds force-pushed the fix/remove-unnecessary-jsx-fragments branch from 623f241 to 2c55473 Compare July 12, 2025 13:56
@aleksei-ds aleksei-ds changed the title Avoid unnecessary React fragments in JSX output of the icon definition map fix(lib): avoid unnecessary React fragments in JSX output of the icon definition map Jul 12, 2025
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.

1 participant