gpt4 book ai didi

reactjs - 如何将 RouterLink 与 Microsoft FluentUI React Link 组件一起使用

转载 作者:行者123 更新时间:2023-12-05 01:36:28 24 4
gpt4 key购买 nike

非常简单。我在其他 Microsoft Fluent UI 上看过 React Router Link 用法的例子控制。不过,我还没有找到将它与 Fluent UI Link 组件一起使用的方法。

最佳答案

能够使用在 Fluent UI Link implementation section 中找到的 as Prop 来实现这一点:

import React from 'react';
import { Link as RouterLink } from 'react-router-dom';

import { Link } from '@fluentui/react';

const ComponentName: React.FC = () => (
<Link as={RouterLink} to="/pathName">
Link Text
</Link>
);

export default ComponentName;

关于reactjs - 如何将 RouterLink 与 Microsoft FluentUI React Link 组件一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61925139/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com