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

159
Visualizações
Find DOM element that rendered React prop

I'm trying to build a tool that takes in any React element, renders it on the screen, and allows you to edit any string-type props that end up rendered on the screen by just clicking on them (WYSIWYG style).

To do this, I want to render the component with some default values for each string prop and when the user clicks on the DOM, if they clicked on an element that is mapped to a prop value then we replace the DOM element with a contentEditable equivalent and update the props for the rendered component based on the user's input.

For example with the following component

const HelloWorld = props => (
    Hello, <div>{props.name}</div>
)

I'd like to render the HelloWorld component with a default value for name such as Bob. When the user clicks on Bob on their screen, the tool would replace the div with content editable and update the prop value for name based on the user's input.

My question is, how can I find the child most DOM element that eventually rendered a given prop?

In the example above, props.name would be mapped to the <div> element.

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