Fix building edit details on props change
- EditForm owns form state - fully uncontrolled component - when props change (e.g. when clicking on another building) the component should completely re-render
This commit is contained in:
parent
44bd5e67d1
commit
566b738f91
@ -32,6 +32,7 @@ const BuildingEdit = (props) => {
|
||||
return (
|
||||
<Sidebar>
|
||||
<EditForm
|
||||
key={props.building_id} // provide key so that React re-creates if props change
|
||||
{...section}
|
||||
{...props}
|
||||
cat={cat}
|
||||
|
@ -29,9 +29,7 @@ const BuildingView = (props) => {
|
||||
return (
|
||||
<Sidebar>
|
||||
<DataSection
|
||||
key={section.slug}
|
||||
cat={cat}
|
||||
building_id={props.building_id}
|
||||
{...section}
|
||||
{...props}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user