反応ルータチュートリアルのようにNavLinkを作成しようとしています。しかし、私は次のように活字体2.1反応が高次のステートレスコンポーネントの小道具で問題になる
import React from 'react';
import { Link, LinkProps } from 'react-router';
const NavLink: React.SFC<LinkProps> = (props) => (
<Link {...props} activeClassName="active" />
);
私は得続けると動作しない理由を把握することはできません。
file: 'file:///Users/bjarkehs/Code/lytzentid-reloaded-frontend/src/components/shared/NavLink.tsx'
severity: 'Error'
message: 'Property 'ref' of JSX spread attribute is not assignable to target property.
Type 'Ref<Link>' is not assignable to type 'string | (string & ((instance: Link) => any)) | (((instance: Component<LinkProps, ComponentState>...'.
Type '(instance: Link) => any' is not assignable to type 'string | (string & ((instance: Link) => any)) | (((instance: Component<LinkProps, ComponentState>...'.
Type '(instance: Link) => any' is not assignable to type '((instance: Component<LinkProps, ComponentState>) => any) & ((instance: Link) => any)'.
Type '(instance: Link) => any' is not assignable to type '(instance: Component<LinkProps, ComponentState>) => any'.'
at: '5,9'
source: 'ts'
これは魅力的に機能しました。ありがとう。私は、反応ルータの入力を更新する必要があると思います。 –