How to dynamically import editor js tools in next js 13 beta version? #2223
Unanswered
Chiranjeev-droid
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How to do dynamic import in nextjs 13 beta version?](https://stackoverflow.com/questions/74841224/how-to-do-dynamic-import-in-nextjs-13-beta-version.
// let CustomEditor = dynamic(() => import("../../components/tools"), {
// ssr: false,
// });
.....
What would be the equivalent code in beta next 13 js?
tools file:-
import Embed from '@editorjs/embed';
import Header from '@editorjs/header';
import Delimiter from '@editorjs/delimiter';
import List from '@editorjs/list';
import Marker from '@editorjs/marker';
const tools = {
embed: Embed,
list: List,
marker: Marker,
header: Header,
delimiter: Delimiter,
};
export default tools;
I am getting this error when i did "use client" for making the page client side and `
let CustomEditor = import("../../components/tools");
`
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of page.
Also i have tried to find the solution by referring on various platforms but not able to find the solution for next js 13.
Github repository with similar issue
Jungwoo-An/react-editor-js#58
Beta Was this translation helpful? Give feedback.
All reactions