[Next.js] Using TypeScript enum outside of dynamic component causes styled.div is not a function
See original GitHub issueWe get the TypeError: styled.div is not a function
when using the GridCellKind
enum outside of the dynamic component in Next.js.
I understand why we need to dynamically import DataEditor
in Next.js but is there a way to import the enum’s independently from the React code?
The work around for us is to copy the enum(s) from the data-grid-types.d.ts
and put them in our code directly to prevent the TypeError.
Issue Analytics
- State:
- Created a year ago
- Comments:16 (16 by maintainers)
Top Results From Across the Web
Error when accessing Typescript enum defined outside Next ...
This is the expected behavior because you're importing a file outside of your application root. TypeScript files are not processed there. You'll ...
Read more >The component styled...has been created dynamically. You ...
you can create a Column component as styles component and make use of props to set the specific attributes const Column = styled.div`...
Read more >Routing in Next.js – How to Set Up Dynamic Routing with Pre ...
While we are focusing on the actual logic of the required code, I won't do any CSS styling whatsoever. Feel free to get...
Read more >React conditional rendering: 9 methods with examples
If you want to iterate over a list to render more than one component or implement some conditional logic, you have to use...
Read more >typescript-cheatsheet - GitHub Pages
Functions as you may expect work exactly the same as in JavaScript with a couple new features ... The reason is because 5...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alpha 5 is rolling now with a fix for that build error
If you want to go the extra mile, modify the next-js project test in this repo to reproduce this on the 5.0.0 branch so I never break this again 😃