Closed zestlee1106 closed 1 month ago
This seems like a create-next-app or next issue, since prop-types hasn’t changed in awhile, and react 19 is the one that drops propType warnings. I’m not sure how this library could cause that.
@ljharb Thank you for your response. Since I’m using React 18, the prop-type warnings should still be functioning as expected, but unfortunately, they are not. As you suggested, this might indeed be a Next.js issue. I’ll proceed with creating an issue in the Next.js repository with this in mind. I appreciate your guidance!
Bug Report
Description
When using Next.js 14 with the App Router, React 18.3.1, and React Router DOM for routing,
PropTypes
warnings are not displaying in the console, even in development mode. This issue occurs despitePropTypes
being correctly defined and used within components.Context and Setup
NODE_ENV=development
)Due to internal constraints, we are using React Router DOM for routing within a single
index.js
page in our Next.js project. Despite this setup, we expectPropTypes
warnings to appear in the developer console when required props are missing.Steps to Reproduce
Create a new Next.js 14 project using
npx create-next-app
.Install
prop-types
andreact-router-dom
usingnpm install prop-types react-router-dom
.Set up routing within a single
page.js
page using React Router DOM:Run the project using
npm run dev
.Observe that even when the
name
prop is missing, noPropTypes
warning is displayed in the browser's developer console.Expected Behavior
In development mode, when a required prop is missing, a
PropTypes
warning should be displayed in the console.Actual Behavior
No
PropTypes
warnings are displayed, even when required props are missing.Additional Context
NODE_ENV
is set todevelopment
.Please let me know if there is any additional information required or if there are any potential workarounds. Thank you!