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

166
Views
ReactDom createPortal child components not working

I tried to create a dropdown menu with createPortal() because of visibility problems due to the stacking context, but the child components are not working as they should. The OperationButton has an onConfirm event.

createPortal(
  <div
    className={`widgetActionsMenu`}
    style={{ position: 'alternative', top: '27px' }}>
    {allowedOperations.map((pseudoOperation) => {
      const [operation, disabled] = pseudoOperation.split(':');
      return (
        <OperationButton
            disabled={!!disabled}
            key={operation}
            operation={operation}
            itemId={props.itemId}
        />
      );
    })}
  </div>
  ,
  document.querySelector(`.flowChartActionLevel`)
)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Actuall assigning it to a ref solved the problem, it now finds the child elements and their properties.

const portalRef = React.useRef(null);
about 4 years ago · Juan Pablo Isaza 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!