Skip to content

Instantly share code, notes, and snippets.

View Pavneet-Sing's full-sized avatar
🎯
Focusing | Open to remote work

Pavneet Singh Pavneet-Sing

🎯
Focusing | Open to remote work
View GitHub Profile
@Pavneet-Sing
Pavneet-Sing / App.js
Last active October 26, 2020 01:08
To efficiently implement the array update events in React
import React, { Component } from "react";
import "./style.css";
export default class App extends Component {
state = {
cart: ["Corn", "Potato"],
};
addNewItem = () => {
this.setState((prevState) => ({