nytimes / react-tracking

🎯 Declarative tracking for React apps.
https://open.nytimes.com/introducing-react-tracking-declarative-tracking-for-react-apps-2c76706bb79a
Other
1.88k stars 123 forks source link

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

Open SharathSreekumar opened 4 hours ago

SharathSreekumar commented 4 hours ago

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:

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.

vishnu-sreenivasan commented 4 hours ago

Facing same issue :cry: