reactt dividir un valor y separarse
state = {
codes : {
first: "test-123",
second: "second-6" ,
seconds: "bet-80",
days: "4-7"
}
}
render(){
const {codes} = this.state
let first,second
const render = Object.keys(codes).map((key) => [
<>
<label>{key} </label>
<label>{first = codes[key].split('-')[0]}</label>
<label>{second = codes[key].split('-')[1]}</label>
</>
])
return (
<>{render}</>
);
}
Alessandro Ballabio