Getting warning "Support for defaultProps will be removed from function components in a future major release."
Opened this issue · 2 comments
SharathSreekumar commented
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
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
Facing same issue 😢
vishnu-sreenivasan commented