For some reason, I am encountering an error while trying to fetch the value of each element in the array using map(). The goal is to make an API call and retrieve user details.
Even though I can see the data on the console, when I attempt to print it, I only get undefined or null. Can someone provide guidance on how to properly map the values here?
types.ts
export const GET_DETAILS = "GET_DETAILS";
export const SET_LOADING = "SET_LOADING";
export const SET_ERROR = "SET_ERROR";
export const SET_ALERT = "SET_ALERT";
...
loginAction.ts
import { ThunkAction } from "redux-thunk";
import { RootState } from "..";
import {
UserAction,
GET_DETAILS,
SET_LOADING,
SET_ERROR,
UserData
} from "../types";
...
User.tsx
import React, { FC } from "react";
import styled from "styled-components";
import { UserData } from "../store/types";
...