Skip to content

ui/simplelistpage: use Component type for createForm #2458

@Forfold

Description

@Forfold

In a PR (#2434) converting a Dialog component to Typescript rendered as a child of SimpleListPage component was forced to set the onClose prop to optional, because in SimpleListPage we clone the passed Dialog component and then append the onClose property to props.

We should think about setting onClose to required for our Dialog components, which would require SimpleListPage to accept a Component instead of a JSX.Element.

E.g.

<SimpleListPage
  createForm={<RotationCreateDialog />}
/>

would change to

<SimpleListPage
  createDialogComponent={RotationCreateDialog}
/>

and we could add a render prop option, too, if some components need to pull off some shenanigans in scope as well:

<SimpleListPage
  renderCreateDialog={(props) => <RotationCreateDialog foo={bar} {...props} />}
/>

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions