I am facing an issue where I am unable to utilize the data after fetching it from a local JSON file. Below are the screenshots showcasing the problem: Here is the data displayed in the console: Here is the code snippet:
fetch('api_link.json')
.then((res) => res.json())
.then((data) => {
console.log('data:', data);
})
export const project_info = () => async (dispatch) => {
try {
dispatch({ type: PROJECT_INFO_REQUEST });
var { data } = await axios.get('HERE I WANT TO PUT THE DATA FROM THE JSON FILE');
dispatch({
type: PROJECT_INFO_SUCCESS,
payload: data,
});
Additionally, here is another screenshot for clarification.
Can anyone provide assistance with this issue?
#note
I am a Python backend developer :)
This is my first time working with React JS.