You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a Menu.Item with the link property set (also as={Link}) and the to property.
Expected Result
Typescript shouldn't fail.
Actual Result
Typescript fails because to is not a property of Menu.Item. Note: The actual generated code works as expected.
error TS2339: Property 'to' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<MenuItemProps, ComponentState>> & { chil...
Version
0.63.1
Testcase
<Menu.Item name='home' link as={Link} to="/home">Home</Menu.Item>
Solution
One possible solution is to add the to?:string prop to Menu.Item's typescript declaration file however that would snowball because technically it would support any property of Link (or any property of whatever class you put in as). Perhaps a better solution would be to separate it as a subclass of Menu.Item i.e. Menu.Item.Link and only use as when you're defining a class that inherits the same properties as Menu.Item.
The text was updated successfully, but these errors were encountered:
Steps
Menu.Item
with thelink
property set (alsoas={Link}
) and theto
property.Expected Result
Typescript shouldn't fail.
Actual Result
Typescript fails because
to
is not a property ofMenu.Item
. Note: The actual generated code works as expected.error TS2339: Property 'to' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<MenuItemProps, ComponentState>> & { chil...
Version
0.63.1
Testcase
<Menu.Item name='home' link as={Link} to="/home">Home</Menu.Item>
Solution
One possible solution is to add the
to?:string
prop toMenu.Item
's typescript declaration file however that would snowball because technically it would support any property ofLink
(or any property of whatever class you put inas
). Perhaps a better solution would be to separate it as a subclass ofMenu.Item
i.e.Menu.Item.Link
and only useas
when you're defining a class that inherits the same properties asMenu.Item
.The text was updated successfully, but these errors were encountered: