You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
When trying to apply properties of type JSX.IonInput to an <IonInput />, there is a type error (Types of property 'placeholder' are incompatible.)
Expected behavior:
There should be no error.
Steps to reproduce:
Create new variable of type JSX.IonInput const props: JSX.IonInput = { };
Create new Element and apply props: <IonInput {...props} />
Other information: Identified problem: placeholder in interface HTMLAttributes located in node_modules/@types/react/index.d.ts is not compliant with placeholder in namespace LocalJSXinterface IonInput located in node_modules/@ionic/core/dist/types/components.d.ts
(one is undefined | string other is undefined | string | null)
…ng only (#23500)
resolves#22976
BREAKING CHANGE: Updated the `placeholder` property on `ion-input`, `ion-textarea`, and `ion-select` to have a type of `string | undefined`.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Bug Report
Ionic version:
see below
Typescript version:
"typescript": "^4.1.3",
Current behavior:
When trying to apply properties of type
JSX.IonInput
to an<IonInput />
, there is a type error (Types of property 'placeholder' are incompatible.
)Expected behavior:
There should be no error.
Steps to reproduce:
JSX.IonInput
const props: JSX.IonInput = { };
<IonInput {...props} />
Related code:
Other information:
Identified problem:
placeholder
ininterface HTMLAttributes
located innode_modules/@types/react/index.d.ts
is not compliant withplaceholder
in namespaceLocalJSX
interface IonInput
located innode_modules/@ionic/core/dist/types/components.d.ts
(one is
undefined | string
other isundefined | string | null
)Workaround:
const props: Omit<JSX.IonInput, 'placeholder'> = { };
Ionic info:
Additional question:
Is there a specific reason why
placeholder
is nullable?The text was updated successfully, but these errors were encountered: