Check out example codes for "g tag in html". It will help you in understanding the concepts better.
Code Example 1
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<!-- Using g to inherit presentation attributes -->
<g fill="white" stroke="green" stroke-width="5">
<circle cx="40" cy="40" r="45" />
<circle cx="60" cy="60" r="25" />
</g>
</svg>
Learn ReactJs, React Native from akashmittal.com