JSFiddle - React, Tailwind, and code Playground

by evgkch

JavaScript

const state = { a: 1 };
state.test = (obj) => state = { ...state, ...obj };
console.log(state.test({ a: 2, b: 1}))