Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.state = {
- productos: [],
- total:0,
- subtotal:0,
- productosSeleccionado:[]
- }
- onclickAgregaProductos(data){
- const randomKey = Math.floor(Math.random() * 100) + 1;
- data.unique = randomKey;
- const newObject = [data, ...this.state.productosSeleccionado];
- //console.log(data);
- this.setState({ productosSeleccionado : newObject});
- //console.log(this.state.productosSeleccionado);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement