'React JS, Spring and Postgres project
For my project, I am building a fitness app with React front-end and Spring back-end. DB I am using is Postgres. I have completed my back-end set up which includes all my controllers. My front-end is supposed to be have a landing page which displays a list of all muscles. I have got that by writing the following code:
const renderedMuscles = muscles.map((muscle) =>{
return <MuscleCard muscle={muscle} key={muscle.id}/>
});
I am then returning {renderedMuscles} which generates a list of muscle items. I am now stuck on the following:
- I want to click on a muscle item and then fetch exercises for the clicked muscle from the DB. For example, clicking on 'chest' should return a list that includes 'bench press', 'dumbbell flies', 'press ups' etc.
- I then want to click on an exercise which brings up a form that has an increment and decrement button for reps, and increment and decrement button for weight and a save button.
How do I progress with this? My instructor suggested that I may have to use react controllers instead of Spring but other than that he doesn't know how I can achieve this or what I can do next. If I create a React router, what is it that I can achieve with it that I can't with my current set up? I am more than half-way through my project and I feel I am really close to completion but really frustrated with what I am stuck on. Any help with this would be much appreciated. Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
