boolean-uk / team-dev-frontend-client

1 stars 11 forks source link

Set up ProfileEdit form control #131

Closed Joelzor closed 1 year ago

Joelzor commented 1 year ago

dependent on #130

Set up state values

Form control

chris2733 commented 1 year ago

If you are using the same currentUser and the same fetch, ie it is the same data it would be wiser to pass this data down to this component - only if this is possible with your current structure. Ideally you want to just work from the one user state, and not fetch multiple times unnecessarily.

Joelzor commented 1 year ago

We considered that but in that way, if the user was to directly access for example, profiles/2/edit in the URL bar, we wouldn't have the data no? I can't imagine many people would do that, but still ;)

chris2733 commented 1 year ago

Not sure on your current structure, but if ProfileEdit is within ProfilePage you would just pass the prop down to the component, so would have access to the data

Joelzor commented 1 year ago

Is it possible to add these issues to the todo list? Could we maybe add fetch in both then try to refactor later if possible?

chris2733 commented 1 year ago

Sure thing, just remember if you are trying to fetch exactly the same thing then you should try to find a way of only doing it once, then passing the data wherever you need :)

Joelzor commented 1 year ago

We'll try to make that work, thank you :) :)