This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 245
Upload images to s3, and update the editor state. #40
Comments
paridin
changed the title
Upload images to s3, and put into state.
Upload images to s3, and update the editor state.
Dec 2, 2016
Src can have any valid value of an image URL, http/https/data. It should work just fine. At what step is the error occurring? After the image URL is successfully generated? |
You should try calling withData(response.data) instead of withData(response) |
Thanks for your help, I saw the bug, I was trying to pass the state to the component so it don't have reference of data object, that's why always I got the error, to reproduce it was looks like
and my editor was look like
to references for people with same issue, my onChange function looks like
so I changes a little bit my called to MyEditor
and when i need retrieve their content I use the reference
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I'm working with medium-draft, I'm using
axios
, andjs aws sdk
to upload files tos3
My first step is to get a signed URL and put my object file, at this point, all works well.
My challenge at this times is put the returned URL to my editor state, I tried differents ways to add it, and I can't figure why it's not working.
I read the medium-draft app, and the example app also and I only found one way to set the state, but it depends on a data context which involves the URL and SRC as attributes of data, That's right? image.js
So I created an anonymous function to get the context of
this
anddata object
at the same level, and I didn't get errors, the problem is I can't display the image over the editor.The onChange functions looks like
What must have src, when you don't generate it as a blob file? like
const src = URL.createObjectURL(file);
? what kind of object is expectingBlock.Image
instead of src blob.The text was updated successfully, but these errors were encountered: