[GH-ISSUE #1127] Missing stars for US flag when used in react-native #528

Closed
opened 2026-03-03 14:39:02 +03:00 by kerem · 11 comments
Owner

Originally created by @rpopovici on GitHub (Jul 28, 2023).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/1127

Originally assigned to: @NotTsunami on GitHub.

This issue was introduced in https://github.com/lipis/flag-icons/pull/1096

I am using react-native v0.70 and react-native-svg to render the SVGs

Originally created by @rpopovici on GitHub (Jul 28, 2023). Original GitHub issue: https://github.com/lipis/flag-icons/issues/1127 Originally assigned to: @NotTsunami on GitHub. This issue was introduced in https://github.com/lipis/flag-icons/pull/1096 I am using `react-native` v0.70 and `react-native-svg` to render the SVGs
kerem 2026-03-03 14:39:02 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@NotTsunami commented on GitHub (Aug 14, 2023):

Wonder if react-native-svg has an issue with the <marker> element

<!-- gh-comment-id:1676681691 --> @NotTsunami commented on GitHub (Aug 14, 2023): Wonder if `react-native-svg` has an issue with the `<marker>` element
Author
Owner

@lipis commented on GitHub (Aug 14, 2023):

@NotTsunami Yes there is an open issue: https://github.com/software-mansion/react-native-svg/issues/1410

<!-- gh-comment-id:1677965608 --> @lipis commented on GitHub (Aug 14, 2023): @NotTsunami Yes there is an open issue: https://github.com/software-mansion/react-native-svg/issues/1410
Author
Owner

@NotTsunami commented on GitHub (Nov 17, 2023):

@rpopovici react-native-svg v14.0.0 was released a few days ago. Is the issue still relevant with the latest version? It's a real shame that marker elements aren't fully supported as they are a really great way to cut the file size of the flag down.

<!-- gh-comment-id:1816860924 --> @NotTsunami commented on GitHub (Nov 17, 2023): @rpopovici `react-native-svg` v14.0.0 was released a few days ago. Is the issue still relevant with the latest version? It's a real shame that marker elements aren't fully supported as they are a really great way to cut the file size of the flag down.
Author
Owner

@rpopovici commented on GitHub (Nov 23, 2023):

@NotTsunami still not working..

<!-- gh-comment-id:1824714415 --> @rpopovici commented on GitHub (Nov 23, 2023): @NotTsunami still not working..
Author
Owner

@NotTsunami commented on GitHub (Oct 3, 2024):

@rpopovici Hi, is this still the case in the latest version of react-native-svg?

<!-- gh-comment-id:2391728087 --> @NotTsunami commented on GitHub (Oct 3, 2024): @rpopovici Hi, is this still the case in the latest version of `react-native-svg`?
Author
Owner

@rpopovici commented on GitHub (Oct 3, 2024):

@NotTsunami stars are still missing from the US flag

<!-- gh-comment-id:2391764235 --> @rpopovici commented on GitHub (Oct 3, 2024): @NotTsunami stars are still missing from the US flag
Author
Owner

@lipis commented on GitHub (Jan 17, 2025):

Not sure what we can do for this one. Closing for now.

<!-- gh-comment-id:2598564472 --> @lipis commented on GitHub (Jan 17, 2025): Not sure what we can do for this one. Closing for now.
Author
Owner

@duochizhacai commented on GitHub (Mar 17, 2025):

any good new ?

<!-- gh-comment-id:2729449355 --> @duochizhacai commented on GitHub (Mar 17, 2025): any good new ?
Author
Owner

@duochizhacai commented on GitHub (Mar 17, 2025):

refactor into component with react-native-svg will fix it.

import Svg, { Marker, Path } from 'react-native-svg';

export const US = () => (
  <Svg id="flag-icons-us" viewBox="0 0 512 512">
    <Path fill="#bd3d44" d="M0 0h512v512H0" />
    <Path
      stroke="#fff"
      strokeWidth="40"
      d="M0 58h512M0 137h512M0 216h512M0 295h512M0 374h512M0 453h512"
    />
    <Path fill="#192f5d" d="M0 0h390v275H0z" />
    <Marker id="us-a" markerHeight="30" markerWidth="30">
      <Path fill="#fff" d="m15 0 9.3 28.6L0 11h30L5.7 28.6" />
    </Marker>
    <Path
      fill="none"
      markerMid="url(#us-a)"
      d="m0 0 18 11h65 65 65 65 66L51 39h65 65 65 65L18 66h65 65 65 65 66L51 94h65 65 65 65L18 121h65 65 65 65 66L51 149h65 65 65 65L18 177h65 65 65 65 66L51 205h65 65 65 65L18 232h65 65 65 65 66z"
    />
  </Svg>
);
<!-- gh-comment-id:2729464694 --> @duochizhacai commented on GitHub (Mar 17, 2025): refactor into component with react-native-svg will fix it. ``` import Svg, { Marker, Path } from 'react-native-svg'; export const US = () => ( <Svg id="flag-icons-us" viewBox="0 0 512 512"> <Path fill="#bd3d44" d="M0 0h512v512H0" /> <Path stroke="#fff" strokeWidth="40" d="M0 58h512M0 137h512M0 216h512M0 295h512M0 374h512M0 453h512" /> <Path fill="#192f5d" d="M0 0h390v275H0z" /> <Marker id="us-a" markerHeight="30" markerWidth="30"> <Path fill="#fff" d="m15 0 9.3 28.6L0 11h30L5.7 28.6" /> </Marker> <Path fill="none" markerMid="url(#us-a)" d="m0 0 18 11h65 65 65 65 66L51 39h65 65 65 65L18 66h65 65 65 65 66L51 94h65 65 65 65L18 121h65 65 65 65 66L51 149h65 65 65 65L18 177h65 65 65 65 66L51 205h65 65 65 65L18 232h65 65 65 65 66z" /> </Svg> ); ```
Author
Owner

@TimRoe commented on GitHub (Jun 23, 2025):

Seeing this mentioned in the react-native-svg bug with markers and having had a similar problem (probably from a teammate getting the SVGs for flags from this package), I worked around this by using GitHub Copilot to brute force make the stars using paths instead of marker so they show in React Native. If helpful:

<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-us" viewBox="0 0 640 480">
  <path fill="#bd3d44" d="M0 0h640v480H0" />
  <path stroke="#fff" stroke-width="37" d="M0 55.3h640M0 129h640M0 203h640M0 277h640M0 351h640M0 425h640" />
  <path fill="#192f5d" d="M0 0h364.8v258.5H0" />
  <g fill="#fff">
    <!-- Stars -->
    <!-- Row 1: 6 stars -->
    <path d="M30,11 l9,27 -23-17h28 l-23,17z" />
    <path d="M91,11 l9,27 -23-17h28 l-23,17z" />
    <path d="M152,11 l9,27 -23-17h28 l-23,17z" />
    <path d="M213,11 l9,27 -23-17h28 l-23,17z" />
    <path d="M274,11 l9,27 -23-17h28 l-23,17z" />
    <path d="M334,11 l9,27 -23-17h28 l-23,17z" />

    <!-- Row 2: 5 stars -->
    <path d="M61,37 l9,27 -23-17h28 l-23,17z" />
    <path d="M122,37 l9,27 -23-17h28 l-23,17z" />
    <path d="M183,37 l9,27 -23-17h28 l-23,17z" />
    <path d="M243,37 l9,27 -23-17h28 l-23,17z" />
    <path d="M304,37 l9,27 -23-17h28 l-23,17z" />

    <!-- Row 3: 6 stars -->
    <path d="M30,63 l9,27 -23-17h28 l-23,17z" />
    <path d="M91,63 l9,27 -23-17h28 l-23,17z" />
    <path d="M152,63 l9,27 -23-17h28 l-23,17z" />
    <path d="M213,63 l9,27 -23-17h28 l-23,17z" />
    <path d="M274,63 l9,27 -23-17h28 l-23,17z" />
    <path d="M334,63 l9,27 -23-17h28 l-23,17z" />

    <!-- Row 4: 5 stars -->
    <path d="M61,89 l9,27 -23-17h28 l-23,17z" />
    <path d="M122,89 l9,27 -23-17h28 l-23,17z" />
    <path d="M183,89 l9,27 -23-17h28 l-23,17z" />
    <path d="M243,89 l9,27 -23-17h28 l-23,17z" />
    <path d="M304,89 l9,27 -23-17h28 l-23,17z" />

    <!-- Row 5: 6 stars -->
    <path d="M30,115 l9,27 -23-17h28 l-23,17z" />
    <path d="M91,115 l9,27 -23-17h28 l-23,17z" />
    <path d="M152,115 l9,27 -23-17h28 l-23,17z" />
    <path d="M213,115 l9,27 -23-17h28 l-23,17z" />
    <path d="M274,115 l9,27 -23-17h28 l-23,17z" />
    <path d="M334,115 l9,27 -23-17h28 l-23,17z" />

    <!-- Row 6: 5 stars -->
    <path d="M61,141 l9,27 -23-17h28 l-23,17z" />
    <path d="M122,141 l9,27 -23-17h28 l-23,17z" />
    <path d="M183,141 l9,27 -23-17h28 l-23,17z" />
    <path d="M243,141 l9,27 -23-17h28 l-23,17z" />
    <path d="M304,141 l9,27 -23-17h28 l-23,17z" />

    <!-- Row 7: 6 stars -->
    <path d="M30,166 l9,27 -23-17h28 l-23,17z" />
    <path d="M91,166 l9,27 -23-17h28 l-23,17z" />
    <path d="M152,166 l9,27 -23-17h28 l-23,17z" />
    <path d="M213,166 l9,27 -23-17h28 l-23,17z" />
    <path d="M274,166 l9,27 -23-17h28 l-23,17z" />
    <path d="M334,166 l9,27 -23-17h28 l-23,17z" />

    <!-- Row 8: 5 stars -->
    <path d="M61,192 l9,27 -23-17h28 l-23,17z" />
    <path d="M122,192 l9,27 -23-17h28 l-23,17z" />
    <path d="M183,192 l9,27 -23-17h28 l-23,17z" />
    <path d="M243,192 l9,27 -23-17h28 l-23,17z" />
    <path d="M304,192 l9,27 -23-17h28 l-23,17z" />

    <!-- Row 9: 6 stars -->
    <path d="M30,218 l9,27 -23-17h28 l-23,17z" />
    <path d="M91,218 l9,27 -23-17h28 l-23,17z" />
    <path d="M152,218 l9,27 -23-17h28 l-23,17z" />
    <path d="M213,218 l9,27 -23-17h28 l-23,17z" />
    <path d="M274,218 l9,27 -23-17h28 l-23,17z" />
    <path d="M334,218 l9,27 -23-17h28 l-23,17z" />
  </g>
</svg>
<!-- gh-comment-id:2997475245 --> @TimRoe commented on GitHub (Jun 23, 2025): Seeing this mentioned in the `react-native-svg` bug with markers and having had a similar problem (probably from a teammate getting the SVGs for flags from this package), I worked around this by using GitHub Copilot to brute force make the stars using `path`s instead of `marker` so they show in React Native. If helpful: ``` <svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-us" viewBox="0 0 640 480"> <path fill="#bd3d44" d="M0 0h640v480H0" /> <path stroke="#fff" stroke-width="37" d="M0 55.3h640M0 129h640M0 203h640M0 277h640M0 351h640M0 425h640" /> <path fill="#192f5d" d="M0 0h364.8v258.5H0" /> <g fill="#fff"> <!-- Stars --> <!-- Row 1: 6 stars --> <path d="M30,11 l9,27 -23-17h28 l-23,17z" /> <path d="M91,11 l9,27 -23-17h28 l-23,17z" /> <path d="M152,11 l9,27 -23-17h28 l-23,17z" /> <path d="M213,11 l9,27 -23-17h28 l-23,17z" /> <path d="M274,11 l9,27 -23-17h28 l-23,17z" /> <path d="M334,11 l9,27 -23-17h28 l-23,17z" /> <!-- Row 2: 5 stars --> <path d="M61,37 l9,27 -23-17h28 l-23,17z" /> <path d="M122,37 l9,27 -23-17h28 l-23,17z" /> <path d="M183,37 l9,27 -23-17h28 l-23,17z" /> <path d="M243,37 l9,27 -23-17h28 l-23,17z" /> <path d="M304,37 l9,27 -23-17h28 l-23,17z" /> <!-- Row 3: 6 stars --> <path d="M30,63 l9,27 -23-17h28 l-23,17z" /> <path d="M91,63 l9,27 -23-17h28 l-23,17z" /> <path d="M152,63 l9,27 -23-17h28 l-23,17z" /> <path d="M213,63 l9,27 -23-17h28 l-23,17z" /> <path d="M274,63 l9,27 -23-17h28 l-23,17z" /> <path d="M334,63 l9,27 -23-17h28 l-23,17z" /> <!-- Row 4: 5 stars --> <path d="M61,89 l9,27 -23-17h28 l-23,17z" /> <path d="M122,89 l9,27 -23-17h28 l-23,17z" /> <path d="M183,89 l9,27 -23-17h28 l-23,17z" /> <path d="M243,89 l9,27 -23-17h28 l-23,17z" /> <path d="M304,89 l9,27 -23-17h28 l-23,17z" /> <!-- Row 5: 6 stars --> <path d="M30,115 l9,27 -23-17h28 l-23,17z" /> <path d="M91,115 l9,27 -23-17h28 l-23,17z" /> <path d="M152,115 l9,27 -23-17h28 l-23,17z" /> <path d="M213,115 l9,27 -23-17h28 l-23,17z" /> <path d="M274,115 l9,27 -23-17h28 l-23,17z" /> <path d="M334,115 l9,27 -23-17h28 l-23,17z" /> <!-- Row 6: 5 stars --> <path d="M61,141 l9,27 -23-17h28 l-23,17z" /> <path d="M122,141 l9,27 -23-17h28 l-23,17z" /> <path d="M183,141 l9,27 -23-17h28 l-23,17z" /> <path d="M243,141 l9,27 -23-17h28 l-23,17z" /> <path d="M304,141 l9,27 -23-17h28 l-23,17z" /> <!-- Row 7: 6 stars --> <path d="M30,166 l9,27 -23-17h28 l-23,17z" /> <path d="M91,166 l9,27 -23-17h28 l-23,17z" /> <path d="M152,166 l9,27 -23-17h28 l-23,17z" /> <path d="M213,166 l9,27 -23-17h28 l-23,17z" /> <path d="M274,166 l9,27 -23-17h28 l-23,17z" /> <path d="M334,166 l9,27 -23-17h28 l-23,17z" /> <!-- Row 8: 5 stars --> <path d="M61,192 l9,27 -23-17h28 l-23,17z" /> <path d="M122,192 l9,27 -23-17h28 l-23,17z" /> <path d="M183,192 l9,27 -23-17h28 l-23,17z" /> <path d="M243,192 l9,27 -23-17h28 l-23,17z" /> <path d="M304,192 l9,27 -23-17h28 l-23,17z" /> <!-- Row 9: 6 stars --> <path d="M30,218 l9,27 -23-17h28 l-23,17z" /> <path d="M91,218 l9,27 -23-17h28 l-23,17z" /> <path d="M152,218 l9,27 -23-17h28 l-23,17z" /> <path d="M213,218 l9,27 -23-17h28 l-23,17z" /> <path d="M274,218 l9,27 -23-17h28 l-23,17z" /> <path d="M334,218 l9,27 -23-17h28 l-23,17z" /> </g> </svg> ```
Author
Owner

@andyford commented on GitHub (Aug 1, 2025):

oh wow thanks for this solution @TimRoe!

For the square version of the icons I just changed viewBox="0 0 640 480" to viewBox="0 0 480 480"

<!-- gh-comment-id:3143563300 --> @andyford commented on GitHub (Aug 1, 2025): oh wow thanks for this solution @TimRoe! For the square version of the icons I just changed `viewBox="0 0 640 480"` to `viewBox="0 0 480 480"`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flag-icons#528
No description provided.