Add Delete / Remove icon to each image #138
|
Is it possible to add remove image from stack? I have no idea how to pass the images array as prop from PhotoAlbum to this component so I can remove one of them by id. Can you help please? const PhotoFrame = memo(
forwardRef<HTMLDivElement, PhotoFrameProps>((props, ref) => {
const {
layoutOptions,
imageProps,
activeIndex,
overlay,
active,
insertPosition,
attributes,
listeners,
setActivatorNodeRef,
} = props;
const { alt, style, ...restImageProps } = imageProps; |
Answered by
igordanchenko
Oct 23, 2023
Replies: 1 comment 1 reply
|
It sounds like you are building on top of the Sortable Gallery example. If that's the case, then you can add Here is a working example - https://codesandbox.io/p/sandbox/react-photo-album-138-9n3hh2?file=%2Fsrc%2FApp.tsx |
1 reply
Answer selected by
pepsiamir
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It sounds like you are building on top of the Sortable Gallery example. If that's the case, then you can add
onRemovecallback to thePhotoFramecomponent and implement that callback inside therenderPhotorender function.Here is a working example - https://codesandbox.io/p/sandbox/react-photo-album-138-9n3hh2?file=%2Fsrc%2FApp.tsx