It's Monday so mostly yeah.
can i ask question?
when i load page at first. it is ok, but when a keyword in search( i go to refresh list because i get new list from Api) my list in api fetch many item , but in my list in this plugin not show ("no items in list" show me)
it is exactly my problem https://github.com/toystars/react-native-multiple-select/issues/13
It probably fetches many time because you aren't throttling the api call. If the result of the fetch doesn't show up, check the network response, it is either empty or you aren't passing the options to the library component.
From the responses, i think you need to set the items state from a useEffect.
i get log it my network is ok and i get it from my api(speed is ok) but in select not show i use from class and after get data from api ( i setState items but in search result is from last list(or first list) )
Does the passed prop to the library change after the fetch?
it is an answer componentWillReceiveProps(nextProps) { this.setState({ items: nextProps.items }); } i donot know where i put it
Pretty sure you shouldn't use .push() in react
First, stop using class components in react.
yes change it sorry i mistake
https://dontasktoask.com
Also advices to pass in an empty array as dependency
it depends. if you want the effect to run only once then yeah. if you want it to run every time the search term change, then you will have to pass the search term state to the deps array.
Обсуждают сегодня