Conversation
roborourke
left a comment
There was a problem hiding this comment.
Are there instances where you'd have just the media ID but not the object? Thinking maybe this could be more useful if it returned the entire media object perhaps, or it could have a second parameter to select a specific property. Then it'd be like useMedia().
In my local work at the moment I'm using it to fetch the source after picking an image, I could rename this to |
|
No that hook doesn't exist to my knowledge, I was just thinking this hook could be more broadly useful, e.g. in case you could fetch dimensions, running time, other media meta data etc... |
|
hmm my concern there is that it would return a media object when the source URL isn't present, but what if it also returned a loading boolean? That way you would know if it's incomplete/loading vs if it doesn't exist or is missing |
Not sure I follow, why would it return a media object if You would get the loading data / boolean I think if you were to just return the value directly from |
Closes #303, adds a quick method of converting an attachment ID into a URL