Skip to content

[Bug]: Support for defaultProps in Function Components to be Removed #2596

@its-me-abhishek

Description

@its-me-abhishek

What happened?

The following warning appears in the console while running the application:
Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

This warning points to the LoadingIndicator component here (and exists in other components as well), which currently relies on defaultProps for setting default values. As this feature will be deprecated in upcoming React versions, the codebase should transition to using default parameter values in function component definitions.

Steps to reproduce

  1. Run the application using the default settings.
  2. Navigate to the link to the UI in browser
  3. Observe the console for the warning.

Expected behavior

The defaultProps should be removed from the codebase and migration should be done similar to this as discussed previously on Slack

Relevant log output

Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

Components to be updated

  • LoadingIndicator
  • BreakableText
  • ErrorMessage
  • NewWindowIcon
  • SearchForm
  • ScatterPlot
  • TraceHeader
  • Ticks
  • TimelineRow
  • AccordianKeyValues
  • AccordianLogs
  • AccordianText
  • KeyValuesTable
  • MiniMap

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions