brianRingler / time-distance-tracker

https://time-distance-tracker.vercel.app
0 stars 1 forks source link

RegisterForm2 thoughts #8

Closed imaricodes closed 11 months ago

imaricodes commented 1 year ago

Keeping with the React concept of keeping components as independent as possible, I think we should move the error messages to the Form component instead of have a separate component for those messages returned from the server (unless there is some need to use the MessageList somewhere else in the app?).

This is also why I moved the state handling and handle submit function to the Form component instead of having it in the page. This also allows the page.jsx to be a server component and the Form component only to be a client component (this is really probably splitting hairs because the page component doesn't really cost much to hydrate the page after the initial DOM loads.

brianRingler commented 1 year ago

Yes, I think the page should be a server component, if possible. Then add client components.

The MessageList could be used on Login, Register or within any page or component that might have an error.

imaricodes commented 1 year ago

I see... yes, the MessageList component is a good idea.