I have to create a text area which taken multiple links then I split()
into array yeah Its working fine, but I want to set that array into my state
in
The below code might help.
onSubmit = event => {
this.setState({ loading: true, host: undefined }, () => {
const { text, linkList } = this.state;
console.log(link);
const mList = text.split("\n").filter(String);
console.log(mList);
this.setState({
linkList: [...mList]
}, () => {
console.log(linkList);
event.preventDefault();
});
});
};