My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How do you structure your frontend state?

Ankit Singhaniya's photo
Ankit Singhaniya
·Feb 22, 2017

I'm working on a large application and I am just not happy with what I do at the connecting interface of my backend and frontend. It's a react app and I have flat state which is optimal for view rendering. But the backend/3rd party api require the data to be in perticular structure. This things is getting very tedious as I have to make an interface and map all the values to some known variables in the function which are then used to create the data in requried format?

Does anyone of you face this similar problem? How can I solve or atleast ease the problem. If I try to manage my state in that format my view logic starts getting complicated.

Is there no escape from this kind of manual mapping? Please ask for any more details which I can add