I have a state like so:
const [array, setArray] = useState([])
I know I can use below code to add an item to an array:
setArray(oldArray => [...oldArray, item])
How can I remove the first element of this array?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment