1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-11-14 17:35:35 +01:00

Add initial form data to children of the ForisForm.

This commit is contained in:
Bogdan Bodnar 2020-05-06 19:28:46 +02:00
parent 8ec0392852
commit cd708fa294
No known key found for this signature in database
GPG Key ID: 49E4169AD3CA42B0
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ WiFiForm.defaultProps = {
};
export default function WiFiForm({
formData, formErrors, setFormValue, hasGuestNetwork, ...props
formData, formErrors, setFormValue, hasGuestNetwork, disabled,
}) {
return formData.devices.map((device) => (
<DeviceForm
@ -45,8 +45,7 @@ export default function WiFiForm({
formErrors={(formErrors || [])[device.id]}
setFormValue={setFormValue}
hasGuestNetwork={hasGuestNetwork}
{...props}
disabled={disabled}
/>
));
}

View File

@ -149,6 +149,7 @@ export function ForisForm({
const childrenWithFormProps = React.Children.map(
children,
(child) => React.cloneElement(child, {
initialData: formState.initialData,
formData: formState.data,
formErrors: formState.errors,
setFormValue: onFormChangeHandler,