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.
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:
Nie korzystam z syncfusion, ale oznaczanie jako private metody w klasie reactowej, która nie jest potem instancjonowana ani żadna inna klasa po niej nie dziedziczy to dla mnie bezsens i wprowadzanie niepotrzebnego zamieszania do kodu.
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.
źródło: comment_WhH5xGCjQM45BbLePYbX7BC0XOW5fWlA.jpg
PobierzKomentarz usunięty przez moderatora
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:
Komentarz usunięty przez moderatora
change: (arg?: ChangedEventArgs) => voidalbochange: EmitTypeinterface Props {change: (event: ChangedEventArgs) => void;
Komentarz usunięty przez autora
change: (arg?: ChangedEventArgs) => void;Załatwiło sprawę, dzięki. Już wiem jak czytać te błędy. ( ͡° ͜ʖ ͡°)
https://github.com/airbnb/javascript/tree/master/react
Nie korzystam z syncfusion, ale oznaczanie jako private metody w klasie reactowej, która nie jest potem instancjonowana ani żadna inna klasa po niej nie dziedziczy to dla mnie bezsens i wprowadzanie niepotrzebnego zamieszania do kodu.