Skip to content

Type Checking With PropTypes: PropTypes and defaultProps cannot be used in React version 19 and above #29510

Open
@Punith1117

Description

@Punith1117

Checks

Describe your suggestion

Issue details:

  • Both PropTypes and defaultProps does not work in functional component
  • defaultProps works but PropTypes doesn't in class component

Possible ways to fix this:

  • [quickest] Mention this same exact fact in the beginning of the article so that people can be aware of this and most importantly preventing wastage of their time in figuring out why it doesn't work (they neither get an error nor a warning when using it) It could be fixed by installing react versions lesser than 19.
  • Remove the whole propTypes and defaultProps concept (this forces the curriculum to teach typescript in detail)

Path

Node / JS

Lesson Url

https://www.theodinproject.com/lessons/node-path-react-new-type-checking-with-proptypes

(Optional) Discord Name

No response

(Optional) Additional Comments

No response

Metadata

Metadata

Assignees

Labels

Status: StaleThis issue/PR has been inactive for over 30 days and will be closed if inactivity continues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions