Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

90
Views
Adding multiple elements issue using ReactDOM.render in react js

I am new to react js and i am trying to add HTML elements multiple times using ReactDOM.render but when I add elements to the dom multiple times the element is replaced each time not added one by one as a new element

this is my code:

  const questionPreview = document.getElementById('question-preview');

  let input = React.createElement("input",{className:"questionTextInput",name:"textInputQuestion[]"},null);
  ReactDOM.render(input,questionPreview);
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

you can use ReactDOM.createPortal inside of ReactDOM.render like this

ReactDOM.render(ReactDOM.createPortal(questionForm,questionPreview), document.createElement('div'));
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!