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

138
Views
React.cloneElement for complex elements

I am using React.cloneElement on a component which is comprised of other divs.

Button.jsx

render() { return <button tabIndex="0" /> }

This Button is then sent as children to AnotherClass. There I want to remove the tabIndex from it, so I am doing this:

AnotherClass.jsx

render() { const children = React.cloneElement(this.props.children, { tabIndex: null });
    return <div tabIndex="0">{children}</div>;);

However this is not working, the children is still rendered with the tabIndex. Is there something wrong with what I am doing?

about 4 years ago · Juan Pablo Isaza
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!