I using react-native-searchable-dropdown library , but if user write string with its not in item array I receive white screen. How I can add no result text (or its best option button who create missing option)?
no result react-native-searchable-dropdown
214 Views Asked by Любомир Мариянов At
2
There are 2 best solutions below
0
On
If you are using flatlist to list all your data. There is a prop called ListEmptyComponent
import React from 'react',
import {FlatList, Button, Text} from 'react-native',
const emptyComponent = () => {
return(
<Text>Search result not found</Text>
<Button title='Do Something'/>
)
};
<FlatList
istEmptyComponent={emptyComponent}
/>
This will display if the search results where not found.
Actually this is work , just i need to add some details , its need to be change the same Searchable dropdown file:
after that i just add
and in function
you can do whatever you want