반응형
useEffect(() => {
if (!imgFile) { return; }
one.activeDimLayer(true);
const objectUrl = URL.createObjectURL(imgFile)
setPreview(objectUrl)
return () => URL.revokeObjectURL(objectUrl) // free memory when ever this component is unmounted
}, [imgFile])
반응형
'web, ui > file, image' 카테고리의 다른 글
이미지로드완료전 로딩바 돌리기 등 하려면 onLoad 이벤트필요 <img onLoad={()=>{...}} onError={()=>{...}, 그런데 onLoad 로컬에선 잘되는데 서버에 올리면 실행이 되다가 안되다가 함 (0) | 2024.06.11 |
---|---|
[파일업로드시 너무 클 때] 413 Request Entity Too Large -chunk분리 (0) | 2024.01.22 |
image upload 부분 구현 (0) | 2022.08.22 |
click시 file download되도록 <a download='fileName'.../> (0) | 2022.08.22 |
get the file size of an image from url and displayed in an <img> (0) | 2022.06.10 |