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

148
Visualizações
Convert String to a JSX Representation

I have a wordpress backend which powers a react front end.

In my wordpress backend, I am trying to build the capability to define pages of react code which I can then dynamically render on the front end. I've figured most of the process out, parsing the HTML of the page with Cheerio and then turning that into react components (using a lookup table with a library of react components and returning the one set on the page).

However, my next goal is to handle more difficult cases, such as JSX style definitions:

<ComponentA
   otherComponents={[<CompB />, <CompC />] />
   

Code like this won't play well with a HTML Parsing library such as cheerio. I am trying to figure out how I can get this to some sort of 'object' form so I can understand it on the javascript side. Prior, cheerio allowed me to parse through each parent and child.

Are there any good Text->JSX Tools available which might assist with this? I realistically don't need JSX, I just need to be able to parse it from text to then dynamically generate my react components

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