Answer the question
In order to leave comments, you need to log in
Why doesn't the [key: string]: any construct work?
Faced the problem of component typing.
Example: https://www.typescriptlang.org/play?#code/JYWwDg9g...
The task is that when passing a component to Pagination, the passed component must receive one data prop, and the rest is optional (and no matter what type) .
But despite the design[key: string]: any
type ComponentProps<T> = {
data: T[];
[key: string]: any;
};
Type 'PropsWithChildren<ComponentProps>' is missing the following properties from type 'CompProps': x, y
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question