Replies: 3 comments 1 reply
-
@gitubbi if you are using in browser its |
Beta Was this translation helpful? Give feedback.
-
Thank you for your nice help Aakansha. I don't know anything about React, so it's a little bit confusing for me. Do you mean I have to do :
or use ExcalidrawLib in another way ? (the excalidraw js file is on my server and loaded on client side by the html file, not taken from npm) I wish to be able to use the JSX syntax to modify the MainMenu, using the example i have seen in docs :
But the class < Excalidraw > is not recognized because i think that the import of Excalidraw module doesn't work. If i code directly in the browser, is it possible to use JSX syntax like above (interpreted by babel), or do we only have access to the Excalidraw api by use of some functions like React.createElement... ? Thank you. |
Beta Was this translation helpful? Give feedback.
-
Finally I have understood how to do it. Just have to know this about React.createElement:
So define an array of items you want in the MainMenu using DefaultItems:
Then add MainMenu array as children of Excalidraw.MainMenu (itself chid of Excalidraw):
This is equivalent to JSX code:
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm trying to use Excalidraw with babel in an html file with :
but I got error:
"The requested module './excalidraw.production.min.js' does not provide an export named 'Excalidraw' "
Can someone show me the good syntax to use Excalidraw module with babel in a html file ?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions