Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
Is there a way to split a large svg with multiple <g> tags into separate files to make react component?

I have a large svg that I am trying to animate in a react app as a component (basically looks like a pitch indicator on an aircraft). The svg I have made on Inkscape has been exported as plain svg and I have used svgr to make it into a component.

The problem is is that there are multiple 'groups' that I want to be able to pass properties to, i.e. transform(x,y). But as the svg is quite large, it's quite unmanageable to work with. The svg has format:

<svg>
<g></g>
<g></g>
:   :
<g></g>
</svg>

Is there any way of turning this into multiple files that I can call into the component file so I can more easily manage the manipulation? i.e.

const component = (some props) => (
<svg> 

<g from another file with props/> e.g. transform
<g from another file with props/> 
etc

</svg> 

)

I am quite new to using this so this may not be the best way of going about doing it (or even possible?). Would anyone have any suggestions of how to go about doing this?

Thanks!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda