bradtraversy / property-pulse

Next.js app for listing and searching rental properties
https://property-pulse-gamma.vercel.app
MIT License
148 stars 76 forks source link

Small question about new server client version of some component markup (PropertyEditForm.jsx) #6

Open televators opened 5 months ago

televators commented 5 months ago

Hey, there. Just got to the final video in the course and am going through and refactoring everything before working on deployment.

While doing the PropertyEditForm component, I noticed that you've got the value attributes of the <option> elements set to defaultValue instead of value. The <select> is the element that actually needs it and the <option>s should have a normal value attribute since they're not changeable by a user. Right? Or am I missing something?

If I try doing it exactly as it is in the refactored branch's PropertyEditForm, it looks like the markup is breaking. The <option> elements are rendered with no values, just the text inside the element, which makes me think they won't work correctly.

Thanks!