Guest User

Untitled

a guest
Dec 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. removeSelectedValue = index => {
  2. console.log("removeSelectedValue--->", index);
  3. let seletedValues = this.state.queryComponents;
  4. seletedValues.splice(index, 1);
  5. console.log("spliced Values--->", seletedValues);
  6. this.setState({ queryComponents: seletedValues });
  7. };
  8.  
  9. render() {
  10. let queryComp = this.state.queryComponents.map((value, index) => {
  11. return (
  12. <AutoCompleteComponent
  13. key={index}
  14. value={value}
  15. index={index}
  16. valueSelected={this.getSelectedValue}
  17. removeSeleted={this.removeSelectedValue}
  18. />
  19. );
  20. });
  21.  
  22. return <div>{queryComp}</div>;
  23. }
Add Comment
Please, Sign In to add comment