Remove defaultProps
Fix for: https://github.com/nytimes/react-tracking/issues/230. I ran the react 19 codemod: npx codemod react/19/replace-default-props --target src within the repo.
@mwildehahn Thanks for submitting this PR, and apologies for taking so long to get to it! Any idea whether this will cause the inverse to happen for older versions of React, i.e. will versions < 18 warn that defaultProps are missing? I'm wondering whether we should update the React peer dependency to just be ^18.0.0 (and maybe remove the prop-types peer dep altogether).
cc @tizmagik
Raised another PR https://github.com/nytimes/react-tracking/pull/234 removing both defaultProps and prop-types. Can we prioritize on fixing this issue as it's a blocker for our react upgrade. Thanks.
Bryan, I can no longer access this repo due to IP access restrictions on NYT GitHub
On Wed, May 7, 2025 at 8:58 PM Bryan Gergen @.***> wrote:
bgergen left a comment (nytimes/react-tracking#231) https://github.com/nytimes/react-tracking/pull/231#issuecomment-2861012874
@mwildehahn https://github.com/mwildehahn Thanks for submitting this PR, and apologies for taking so long to get to it! Any idea whether this will cause the inverse to happen for older versions of React, i.e. will versions < 18 warn that defaultProps are missing? I'm wondering whether we should update the React peer dependency to just be ^18.0.0 (and maybe remove the prop-types peer dep altogether).
cc @tizmagik https://github.com/tizmagik
— Reply to this email directly, view it on GitHub https://github.com/nytimes/react-tracking/pull/231#issuecomment-2861012874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB3XYESZOXA3MR6DWDHUPT25KT4FAVCNFSM6AAAAABRHKYM2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNRRGAYTEOBXGQ . You are receiving this because you were mentioned.Message ID: @.***>