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

useParams hook stopped working for dynamic plugins

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • 4.15
    • Management Console
    • None
    • Critical
    • No
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      Since console started using react-router-dom-v5-compat package, the useParams hook has to be also imported from that package in order to work.
      
      This is a breaking change for any dynamic plugin that is importing the hook from `react-router`. The hook imported from `react-router` simply returns an empty object. It does not fail build or anything, just does not work correctly in runtime.

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

      4.15    

      How reproducible:

          always

      Steps to Reproduce:

          1. in dynamic plugin import `useParams` hook from `react-router`
          2. use the hook and expect it to return object with route parameters

      Actual results:

          object is empty

      Expected results:

          object has parameters

      Additional info:

          

            vszocs@redhat.com Vojtech Szocs
            rawagner@redhat.com Rastislav Wagner
            YaDan Pei YaDan Pei
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: