Answer the question
In order to leave comments, you need to log in
Problem when using ref, throws an error?
Good afternoon, please tell me, when using the keen slider, it displays the following error: Type 'RefObject' is not assignable to type 'LegacyRef'.
perhaps these are some features of Typescript, but I'm new to it, so I don't understand a bit: swears here I
tried to set the default value useRef (null) did not help
Answer the question
In order to leave comments, you need to log in
Where is the code, Vasya?
Nothing can be said without code, because such an error is impossible in normal code, the types are absolutely compatible:
declare let refObject: RefObject<'some'>;
declare let legacyRef: LegacyRef<'some'>;
legacyRef = refObject; // ok
useRef<Тип>(null)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question