Uploaded image for project: 'Stripes'
  1. Stripes
  2. STRIPES-746

fix code that generates console warnings and errors

    XMLWordPrintable

Details

    • Epic
    • Status: Open (View Workflow)
    • TBD
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • None

    Description

      Summary: As stated in our release guidelines, code "should not emit any warnings on the JavaScript console", yet we have lots of code that does. This includes:

      • PropTypes errors due to bad isRequired statements. If you're seeing this warning, the prop is not, in fact, always present in the calling code.
      • PropTypes errors that are just wrong. Often, an item is later replaced by a list, or an object by an array depending on which part of a resource is supplied i.e. the full resource (an object) or just its records (an array)).
      • PropTypes errors due to bad shape. This is common for refs; the correct PropType is:
        PropTypes.oneOfType([
              PropTypes.func,
              PropTypes.shape({ current: PropTypes.instanceOf(Element) })
            ]),
        
      • Memory leaks due to updating state in promises that finish executing after a component has unmounted:
        Warning: Can't perform a React state update on an unmounted component. 
        This is a no-op, but it indicates a memory leak in your application. To fix, 
        cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
        

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                zburke Zak_Burke
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:

                  TestRail: Runs

                    TestRail: Cases