How to use addFiles function? #4351
Unanswered
yuvrajchaudhari03
asked this question in
Q&A
Replies: 2 comments
-
This is how I use AddFiles in the Obsidian-Excalidraw plugin |
Beta Was this translation helpful? Give feedback.
0 replies
-
@yuvrajchaudhari03 I'd recommend using TypeScript. We generally don't write defensive code that works with invalid input. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I got my answer thanks
Answer
Never call addFiles function without passing any parameter or else it will throw an error and crash the app
excalidrawRef.current.addFile(ImgData)
where ImgData is
[ { created: 1638377062740, dataURL: "data:image/jpeg;base64,/9j/4AAQSkZJR....", id: "5dd622b1f75815194a2d87a8f104d60519776600", mimeType: "image/jpeg", }, { created: 1638377337782, dataURL: "data:image/jpeg;base64,/9j/4AAQSk......", id: "f77f811429dc41ac4460b065ed4f6e6cc7a5e213", mimeType: "image/jpeg", } ]
Beta Was this translation helpful? Give feedback.
All reactions