- Since you are using typescript, you should do the type definition or simply
any
try const [usersData, setUsersData] = React.useState<any[]>([]);
React.useEffect(() => {
setUsersData(result => [...result, ...data])
props.setLoading(false);
}, []);
CLICK HERE to find out more related problems solutions.