Skip to content

Commit

Permalink
Remove declaration in render method and move it outside the component
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustoAleGon committed Nov 23, 2019
1 parent 0050e58 commit e3ce436
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,48 +36,49 @@ import React, { Component } from 'react';
import { View } from 'react-native';
import MultiSelect from 'react-native-multiple-select';

class MultiSelectExample extends Component {

state = {
selectedItems : [];
};


onSelectedItemsChange = selectedItems => {
this.setState({ selectedItems });
};

render() {
const { selectedItems } = this.state;

const items = [{
const items = [{
id: '92iijs7yta',
name: 'Ondo',
name: 'Ondo'
}, {
id: 'a0s0a8ssbsd',
name: 'Ogun',
name: 'Ogun'
}, {
id: '16hbajsabsd',
name: 'Calabar',
name: 'Calabar'
}, {
id: 'nahs75a5sg',
name: 'Lagos',
name: 'Lagos'
}, {
id: '667atsas',
name: 'Maiduguri',
name: 'Maiduguri'
}, {
id: 'hsyasajs',
name: 'Anambra',
name: 'Anambra'
}, {
id: 'djsjudksjd',
name: 'Benue',
name: 'Benue'
}, {
id: 'sdhyaysdj',
name: 'Kaduna',
name: 'Kaduna'
}, {
id: 'suudydjsjd',
name: 'Abuja',
}];
name: 'Abuja'
}
];

class MultiSelectExample extends Component {

state = {
selectedItems : [];
};


onSelectedItemsChange = selectedItems => {
this.setState({ selectedItems });
};

render() {
const { selectedItems } = this.state;

return (
<View style={{ flex: 1 }}>
Expand Down

0 comments on commit e3ce436

Please sign in to comment.