Я недавно обновил все реагирующие библиотеки до последней и всех ее типов. У меня проблема с компиляцией машинописи. Это говорит
[ts] Type '{ history: History<any>; location: Location<any>; match: match<any>; staticContext?: StaticContext; }' is not assignable to type 'LibraryManagedAttributes<T["component"], Readonly<{ children?: ReactNode; }> & Readonly<{ history: History<any>; location: Location<any>; match: match<any>; staticContext?: StaticContext; }>>'. [2322]
type PrivateRouteProps = UserAuthStore.UserAuthState &
typeof UserAuthStore.actionCreators &
RouteProps &
{ component: typeof React.Component };
class PrivateRoute<T extends PrivateRouteProps = PrivateRouteProps> extends React.Component<T, {}> {
render() {
let auth = new Auth();
const {
isAuthenticated,
component: Component,
...props
} = this.props
if (!isAuthenticated) {
console.log(this.props)
window.location.href = auth.getAuthorizeUrl(this.props.location!.pathname!)
}
return (
<Route
{...props}
render={props => isAuthenticated ? <Component {...props} />: (<div>Redirecting...</div>)}
/>
)
}
}
Я получаю ошибку на <Component {...props} />
в «Компоненте».