You could also just use data URIs in your CSS.
“How else could you possibly have SVGs render inline other than to include a massively bloated JS representation of a string in your bundle?”
- the React ecosystem, 2023
The answer, as you’ve shown, is “use the platform”. Sometimes I feel like React actively works against that.