Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-56094

[regression] OCP Console re-renders plugin pages constantly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Undefined Undefined
    • None
    • 4.19
    • Management Console
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      The console constantly re-renders dynamic plugin pages.

      Version-Release number of selected component (if applicable):

      4.19

      How reproducible:

      always

      Steps to Reproduce:

      1. create a dynamic console plugin with the following React code:
      
      import React, { memo } from 'react';
      import { useNavigate } from 'react-router-dom-v5-compat';
      
      let rerenders = 0;
      function TestPageBug() {
        const navigate = useNavigate();
        console.log('TestPageBug render');
        return <div>TestPageBug re-renders: {rerenders++}</div>;
      }
      
      export default memo(TestPageBug);
      

      Actual results:

      the counter on the page keeps increasing every 10-15 seconds

      Expected results:

      the page never re-renders

      Additional info:

      If I uncomment the useNavigate() hook, the page does not rerender.
      If I use the useParams() hook, the page also constantly re-renders.
      
      I assume it's linked to the react-router change in 4.19. With OCP 4.18, this bug does not happen.
      
      Depending on the page, the re-rendering may be not noticeable in the best case, and causes flickers and cache resets in the worst case.

       

              cajieh Cyril Ajieh
              cajieh Cyril Ajieh
              None
              None
              YaDan Pei YaDan Pei
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: