R
Reactiflux

help-threads-react

Deepak – 07-11 Oct 21

DDeepak10/21/2022
Hello, how can i tweak this ?
const [state1, setState1] = useState({
data: ["a", "b", "c", "d"],
title: "albhabets"
});
const state2 = [{ data: ["e", "f"], title: "albhabets" }];

const merge = () => {
setState1([...state1.data, ...state2.data]);
console.log(state1);
};
const [state1, setState1] = useState({
data: ["a", "b", "c", "d"],
title: "albhabets"
});
const state2 = [{ data: ["e", "f"], title: "albhabets" }];

const merge = () => {
setState1([...state1.data, ...state2.data]);
console.log(state1);
};
https://codesandbox.io/s/busy-currying-ju23ke?file=/src/App.js:103-367
UUUnknown User10/21/2022
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

help-threads-react

Join Server