nytimes/react-tracking

Getting warning "Support for defaultProps will be removed from function components in a future major release."

Opened this issue · 2 comments

Issue

Getting a warning on the browser console "Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.".
This happened post upgrade to the following:

  • React: 18.2.0
  • react-tracking: 9.3.2 (tried downgrading till 9.2.1, below versions require 16.8.0 or 17.x)
  • @types/react-tracking: 8.0.0
    Screenshot from 2024-10-01 14-48-48

Details

The warning is shown on components that either has class component (hence using the decorator @track({<DETAILS>})) and in functional components (using the export default track({<DETAILS>})(Componentx))

On trying with the packages hook, the warning is not shown.
const { Track, trackEvent } = useTracking({<DETAILS>});

NOTE: React project is written in Typescript.

Facing same issue 😢

@tizmagik @bgergen may I know whether there is any plan to merge the PR?