I'm currently working on an app that involves fetching data from my own API. The goal is to retrieve user-specific information and use it within the app. However, I've encountered a roadblock with CORS headers and I'm unsure of how to proceed.
In summary:
- I fetch the data in the
componentDidMount
phase - Parse the retrieved data
- Integrate it into my app's state
The issue arises when fetching the data as CORS protocol blocks my request. Unfortunately, I'm stumped on how to resolve this within the settings of next.js
.