return the default step layout form if a custom one is not found

Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
Paul Cowan
2022-09-05 14:59:34 +01:00
committed by blam
parent dd3f5b05f5
commit 1d6a3cbe22
@@ -15,6 +15,7 @@
*/
import { UiSchema } from '@rjsf/core';
import { DefaultStepFormLayout } from '../components/layouts/DefaultStepFormLayout';
import { DEFAULT_SCAFFOLDER_LAYOUT } from './default';
import { LayoutOptions, LayoutTemplate } from './types';
@@ -31,7 +32,7 @@ export function resolveStepLayout(
)?.component;
if (!LayoutComponent) {
throw new Error(`no step layout found for ${layoutName}`);
return DefaultStepFormLayout;
}
return LayoutComponent;