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

Invalid ref in NextJS #387

Open
mikku489 opened this issue Nov 6, 2022 · 0 comments
Open

Invalid ref in NextJS #387

mikku489 opened this issue Nov 6, 2022 · 0 comments

Comments

@mikku489
Copy link

mikku489 commented Nov 6, 2022

Is there a way to pass the ref to custom cell renders in NextJS environment?

The Inline Editing example in the documentation website doesn't work in NextJS because the ref provided to EditableCell is always null. I have tried various workarounds like loading the component dynamically and then using React.ForwardRef (link) but nothing seems to work. Even tried disabling SSR explicitly. The ref passed in is only valid after the first render cycle and it seems in the EditableCell class it tries to render with a null ref. You have some code protecting against this situation: {editing && this.targetRef && ( but I'm wondering if there is a nicer or cleaner way to do this? I'm mainly looking for a way to edit the cell items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant