Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to react 19, throws errors on custom blocks - Accessing element.ref was removed in React 19. ref is now a regular prop. #1293

Closed
dvarjun opened this issue Dec 1, 2024 · 1 comment · Fixed by #1317
Labels
bug Something isn't working

Comments

@dvarjun
Copy link

dvarjun commented Dec 1, 2024

Describe the bug
Custom blocks throws run time console error after upgrading to react 19.
Console error: “Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.”

Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release. Component Stack:
r ReactBlockSpec.tsx:162
ReactNodeView unknown:0
Ao EditorContent.tsx:6
Uo EditorContent.tsx:28
Wo BlockNoteView.tsx:91
MantineThemeProvider MantineThemeProvider.tsx:17
MantineProvider MantineProvider.tsx:13
dt index.tsx:141
App App.tsx:126
:1:145535

To Reproduce
goto examples/06-custom-schema/react-custom-blocks
Upgrade react pkgs in package.json with the following:
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106"

Browser: Firefox and Chrome
Open browser console and you would see the error when the page loaded.

Here is the stackblitz link:
https://stackblitz.com/~/github.com/dvarjun/react19-bug-react-custom-blocks

@dvarjun dvarjun added the bug Something isn't working label Dec 1, 2024
@dvarjun dvarjun changed the title Upgrading to react 19, throws errors on custom components - Accessing element.ref was removed in React 19. ref is now a regular prop. Upgrading to react 19, throws errors on custom blocks - Accessing element.ref was removed in React 19. ref is now a regular prop. Dec 1, 2024
@ezelbanaan
Copy link

duplicate of #1287 right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants