'all user list gmail ,id ,name are not showing in userlist
function UserListScreen() {
const dispatch = useDispatch();
const userList = useSelector((state) => state.userList);
const { loading, error, users } = userList;
useEffect(() => {
dispatch(listUsers);
}, [dispatch]);
return (
<div>
<h1>Users</h1>
{loading ? (
<Loader />
) : error ? (
<Message variant="danger">{error}</Message>
) : (
<Table striped bordered hover responsive className="table-sm">
<thead>
<tr>
<th>ID</th>
<th>NAME</th>
<th>EMAIL</th>
<th>ADMIN</th>
<th></th>
</tr>
</thead>
<tbody>
{users.map((user) => (
<tr key={user._id}>
<td>{user._id}</td>
<td>{user.name}</td>
<td>{user.email}</td>
<td>
{user.isAdmin ? (
<i className="fas fa-check" style={{ color: "green" }}></i>
) : (
<i className="fas fa-check" style={{ color: "red" }}></i>
)}
</td>
</tr>
))}
</tbody>
</Table>
)}
</div>
);
}
export default UserListScreen;
all user list will show their id , name, and email but only show <h2> not showing data from the backend
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
