react-smart-data-table
react-smart-data-table copied to clipboard
"ReferenceError: self is not defined" when using blitz
Expected Behavior
Should show me the table with the data
Actual Behavior
Throwin error "ReferenceError: self is not defined"
Steps to Reproduce
Import the package and writing <SmartDataTable /> in the render function
Screenshot

Your Environment
Blitz.js is the fullstack framework includes Node.js, Next.js (Server-side rendering), React and Prisma.
Thank you for submitting this issue!
I will stop transpiling the library to ES5 and it should fix this issue. Since it uses React and JSX, it will always require transpiling anyway.
I found the solution. I can use the dynamic import for the component, where I use the SmartDataTable. For example, I have a component Table, where I use SmartDataTable, and I can dynamically import the Table component, and there will be no issue.
https://blitzjs.com/docs/code-splitting - docs about dynamic import in Blitz.js.
I don't think that the bug or something, and the package is just not made for SSR. You can add SSR support. I'm sure it will help for people. Thank you for response.
Thank you for sharing your solution, @skhashaev! I'll see how I can support SSR as those technologies are becoming more popular. For the meantime, I can link this issue on the documentation.