You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What you were expecting:
No console errors when using NumberField after updating to react 18.3.1
What happened instead:
When using react-admin with react 18.3.1, the following error gets thrown
Warning: NumberFieldImpl: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.
Import NumberField and use it in any page, then check the console
Related code:
https://stackblitz.com/edit/github-erftms?file=package.json
The only changes done in the fork above is updating react and react-dom to v18.3.1, and if you go to the posts list, there is a <NumberField /> there, so you should see the error:
Environment
React-admin version: 4.16.16
Last version that did not exhibit the issue (if applicable): -
React version: 18.3.1
Browser: Brave (but shouldn't matter)
Stack trace (in case of a JS error):
Warning: NumberFieldImpl: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.
at td
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at TableCell2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-KYU5CILM.js?v=0454cae4:36862:17)
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:114618:24
at tr
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at TableRow2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-KYU5CILM.js?v=0454cae4:37745:17)
at RecordContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:9557:23)
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:114821:24
at tbody
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at TableBody2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-KYU5CILM.js?v=0454cae4:36737:17)
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:114986:23
at table
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at Table2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-KYU5CILM.js?v=0454cae4:36643:17)
at div
at div
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at DatagridContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:115327:23)
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:115493:20
at DatagridWithPreferences (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:115706:23)
at span
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at PreferenceKeyContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:15316:18)
at Configurable (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:23052:24)
at DatagridConfigurable (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:115671:28)
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at div
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at Paper2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-KYU5CILM.js?v=0454cae4:1754:17)
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at Card2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-KYU5CILM.js?v=0454cae4:20436:17)
at div
at div
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at ListView (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:125564:20)
at ListContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:10729:20)
at ResourceContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:14519:23)
at ListBase (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:10978:23)
at List (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:125726:24)
at PostListDesktop
at PostList (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/src/posts/PostList.tsx:361:19)
at RenderedRoute (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-HQCFJLUO.js?v=0454cae4:3578:5)
at Routes (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-HQCFJLUO.js?v=0454cae4:4081:5)
at ResourceContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:14519:23)
at Resource (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:14525:23)
at RenderedRoute (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-HQCFJLUO.js?v=0454cae4:3578:5)
at Routes (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-HQCFJLUO.js?v=0454cae4:4081:5)
at Suspense
at ErrorBoundary2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:23928:35)
at div
at main
at div
at div
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at Layout (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:24324:20)
at default
at div
at RenderedRoute (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-HQCFJLUO.js?v=0454cae4:3578:5)
at Routes (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-HQCFJLUO.js?v=0454cae4:4081:5)
at CoreAdminRoutes (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:14391:3)
at RenderedRoute (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-HQCFJLUO.js?v=0454cae4:3578:5)
at Routes (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-HQCFJLUO.js?v=0454cae4:4081:5)
at CoreAdminUI (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:14466:20)
at div
at https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-QHPMH4O3.js?v=0454cae4:2006:50
at ScopedCssBaseline2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-KYU5CILM.js?v=0454cae4:31124:17)
at AdminUI (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:126300:18)
at RtlProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-FMQ574TI.js?v=0454cae4:900:5)
at ThemeProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-FMQ574TI.js?v=0454cae4:858:5)
at ThemeProvider2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-FMQ574TI.js?v=0454cae4:940:5)
at ThemeProvider3 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-FMQ574TI.js?v=0454cae4:2719:12)
at ThemeProvider2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:21672:23)
at ResourceDefinitionContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:14024:18)
at NotificationContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:5131:23)
at I18nContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:15274:18)
at Router (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-HQCFJLUO.js?v=0454cae4:4024:15)
at HistoryRouter (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:5603:23)
at InternalRouter (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:5643:23)
at BasenameContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:5623:23)
at AdminRouter (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:5629:22)
at QueryClientProvider2 (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-G7FG52HX.js?v=0454cae4:2852:25)
at PreferencesEditorContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:13940:23)
at StoreContextProvider (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:5037:20)
at CoreAdminContext (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:14050:28)
at AdminContext (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/chunk-4GCPQNT7.js?v=0454cae4:126336:21)
at Admin (https://githuberftms-jbcp--8080--0314a412.local-credentialless.webcontainer.io/node_modules/.vite/deps/react-admin.js?v=bba800ac:667:28)
The text was updated successfully, but these errors were encountered:
What you were expecting:
No console errors when using
NumberField
after updating to react 18.3.1What happened instead:
When using react-admin with react 18.3.1, the following error gets thrown
This probably comes from https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/field/NumberField.tsx#L109-L111, and will probably break when react 19 is introduced
Steps to reproduce:
Import NumberField and use it in any page, then check the console
Related code:
The only changes done in the fork above is updating react and react-dom to v18.3.1, and if you go to the posts list, there is a
<NumberField />
there, so you should see the error:Environment
The text was updated successfully, but these errors were encountered: