Uploaded image for project: 'OpenShift Dev Console'
  1. OpenShift Dev Console
  2. ODC-5751

elements not available on first render

XMLWordPrintable

    • ODC Sprint 202
    • Low

      Description of problem: 

      elements in quick start markdown are not present on the first render. so using the QuerySelectorAll with useMemo returns an empty list on first render but since we are using useMemo and dependencies array doesn't detect any change with `document` on the subsequent render even though elements are present in dom.

      https://github.com/openshift/console/pull/8527#discussion_r610869592

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

      1. The issue can be reproduced in the MarkdownCopyClipboard.tsx or MarkdownExecuteSnippet.tsx by wrapping the document.querySelectorAll call with useMemo

      Actual results: 

      useMemo returns an empty list

      Expected results: 

      elements should be present and useMemo should return all the element matching the query selector

      Reproducibility (Always/Intermittent/Only Once): always

      Build Details:

      Additional info:

            sbudhwar-1 Sahil Budhwar
            sbudhwar-1 Sahil Budhwar
            Gajanan More Gajanan More (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: