Open MattRueter opened 1 year ago
@Melton-Paul @tylerthietje @Pavubrar
Working on the first of the two tasks related to this. (open SkillForm in 'edit' mode with prepopulatedData). I'm having a tricky time passing props into the SkillForm. It is being called from a Link component in SkillCard. As a work around I've used the useLocation() hook from 'react-router-dom' library and that works for getting the given skill's data into the component. However it meant adding a bit of confusing (and possibly buggy code...see my code for example ! ) which then assigns this to the prepopulatedData variable which seems a bit hacky and odd. Any ideas on how to better handle this?
*I'm referring to branch: _fetch-userdata files: src/components/SkillCard and src/components/SkillForm
@Pavubrar I'll probably re-configure the UserContext (and therefore the skills object this edit button makes use of). But will send a message around (on Discord) once I've done that. My goal is to have that done by Tuesday April, 11th (13:00).
When that is ready the < on submit> logic for this form when in
[x] Clicking the edit button opens up the add skill/edit form in "edit mode" populated with skill's data.
[x] Changes saved locally and pushed to DB OR pushed to DB and fetch data again ?