Wpis z mikrobloga

#react #syncfusion #frontend #programowanie

Zacząłem się bawić komponentami z syncfusion i przy podstawach strzela mnie szlag.
Dla zdarzenia change z komponentu TextBox jak dam any to działa wszystko, ale muszę rzutować w obsłudze tego zdarzenia. Natomiast jak zamiast any dam EmitType co jest w dokumentacji TextBox Syncfusion, to mam niżej przedstawiony błąd.

Ktoś jakiś trop? To zapewne jest bardzo proste, próbowałem zmieniać typy wynikowe etc. ale no nie pomaga.
virnik - #react #syncfusion #frontend #programowanie 

Zacząłem się bawić komponent...

źródło: comment_WhH5xGCjQM45BbLePYbX7BC0XOW5fWlA.jpg

Pobierz
  • 15
Type '(event: EmitType) => void' is not assignable to type 'EmitType'.
Type '(event: EmitType) => void' is not assignable to type '(arg?: ChangedEventArgs | undefined, ...rest: any[]) => void'.
Types of parameters 'event' and 'arg' are incompatible.
Type 'ChangedEventArgs | undefined' is not assignable to type 'EmitType'.
Type 'undefined' is not assignable to type 'EmitType'.
Type 'undefined' is not assignable to type 'AngularEventEmitter'.

@LazyInitializationException:
The expected type comes from property 'change' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: string | number | boolean | {} | ReactElement ReactElement Component<...>)> | null) | (new (props: any) => Component<...>)> | ... 4 more ... | undefined; }>...'
@LazyInitializationException:
@DVNK: dla

interface Props {
change: (event: ChangedEventArgs) => void;
}

mam

Type '(event: ChangedEventArgs) => void' is not assignable to type 'EmitType'.
Type '(event: ChangedEventArgs) => void' is not assignable to type '(arg?: ChangedEventArgs | undefined, ...rest: any[]) => void'.
Types of parameters 'event' and 'arg' are incompatible.
Type 'ChangedEventArgs | undefined' is not assignable to type 'ChangedEventArgs'.
Type 'undefined' is not assignable to type 'ChangedEventArgs'.

a dla dla

interface