Autodesk/react-base-table

Invalid ref in NextJS

mikku489 opened this issue · 0 comments

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.