Skip to content

[TypeScript] Compilation error when using the <InputGuesser multiline> attribute #574

@fzaninotto

Description

@fzaninotto

API Platform version(s) affected: 5.0.0

Description

InputGuesser is supposed to pass down all the props it receives to the guessed input. So it must accept all the possible props of all possible inputs.

This works fine for many props (label, readOnly, etc) but not for multiline:

image

How to reproduce

Write the following code:

import { EditGuesser, InputGuesser } from "@api-platform/admin";

export const BookEdit = () => (
  <EditGuesser warnWhenUnsavedChanges>
    <InputGuesser source="isbn" label="ISBN" />
    <InputGuesser source="title" />
    <InputGuesser source="author" />
    <InputGuesser source="description" multiline />
    <InputGuesser source="publicationDate" />
  </EditGuesser>
);

Possible Solution

Fix the types!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions