Here's the problem with iterating over the components as array elements, I guess. I tried many iteration methods for loop, .forEach() and .map(). The some result was came only from the first one. It was rendered only one component from the array, when famous methods .forEach() and .map() wasn't rendered nothing at all.
I logged to the console the value of iterator variable from the above for loop and it wasn't incremented at all, it was 0, when the max count is 10.
Here's the code:
const renderState = () => {
if (loading) {
// When the users objects are loading from the server:
return <p>Loading...</p>;
} else if (hasErrors) {
// When some loading-error occured:
return <p>Can not load the page.</p>;
} else {
// And when loading was successfully finished, rendering all of them:
for (let i = 0; i < users.length; i++) {
return <ProfileCard key={users[i].id} user={users[i]} />
}
}
};