We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
hey people how can I change this class component into functional component
Sorry, something went wrong.
simple example with functional components
import React, {useState, Fragment} from 'react'; import SearchableDropdown from 'react-native-searchable-dropdown'; const items = [ {id: 1, name: 'JavaScript',}, {id: 2, name: 'Java',}, {id: 3, name: 'Ruby',}, {id: 4, name: 'React Native',}, {id: 5, name: 'PHP',}, {id: 6, name: 'Python',}, {id: 7, name: 'Go',}, {id: 8, name: 'Swift',}, ]; const App: () => Node = () => { const [selectedItems, setSelectedItems] = useState([]); const addItem = (item) => { setSelectedItems(item) } return ( <Fragment> <SearchableDropdown containerStyle={{ padding: 5, width: '40%' }} selectedItems={selectedItems} onTextChange={text => console.log(text)} onItemSelect={addItem} items={items} defaultIndex={1} textInputStyle={{ padding: 12, borderWidth: 1, borderColor: '#ccc', backgroundColor: '#FAF7F6', }} itemStyle={{ padding: 10, marginTop: 2, backgroundColor: '#FAF9F8', borderColor: '#bbb', borderWidth: 1, }} itemTextStyle={{ color: '#222', }} itemsContainerStyle={{ maxHeight: '80%', }} resetValue={false} > </SearchableDropdown> </Fragment> ); }; export default App;
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: