mdjfs / expo-image-multiple-picker

Fully customizable image picker for react native
https://npmjs.com/expo-image-multiple-picker
MIT License
21 stars 7 forks source link

How do we access assets in custom Header save function? #14

Closed heesungjang closed 1 year ago

heesungjang commented 1 year ago

Hi, first of all thank you so much for this great package. I trying to use custom header, but little bit confused here.

interface HeaderData {
  view: Views
  goToAlbum?: () => void
  imagesPicked: number
  multiple: boolean
  picked: boolean
  album?: Album
  noAlbums: boolean
  save?: () => void
}

How can i access to current assets like default onSave function? so that i can to somthing within custom header?

thanks in advnace!

mdjfs commented 1 year ago

Hello! How are you? Thanks for the feedback !

Calling the void save will fire the onSave function of the picker with the Assets. I don't know why you need know the Assets to build your custom Header.

Check the WhatsAppHeader in the documentation. I uses props.save in the button and under the hood that calls the onSave function with the actual assets

heesungjang commented 1 year ago

@mdjfs Hello! Thanks for the reply. Yes I misunderstood the api. It workign fine! thanks!