Reactjs – Can't add an object to an array because it's not the type "never" in react
I'm trying the following code: https://playcode.io/2047320 import React, { useState } from 'react'; export default function App() { const [example, setExample] = useState([]); const ButtonClick = () => { setExample([...example, { id: 'Hi', another: 12 }]); }; return ( <div…