【发布时间】:2021-12-17 13:23:53
【问题描述】:
问题: 点击链接时,地址正在解析react-router-dom中Link的“to”属性值,请看输出: http://localhost:3000/https://xxxxxx.github.io/
import React from 'react';
import { Link } from 'react-router-dom';
const Footer = () => {
return (
<footer className='footer-light bg-light'>
<div
className='text-center p-3'
>
<Link
className='text-decoration-none text-dark'
to='https://xxxxxxx.github.io/'
>
© {new Date().getFullYear()} Copyright
</Link>
</div>
</footer>
);
};
export default Footer;
我想在点击链接时重定向到另一个页面
【问题讨论】:
-
在你的
localhost。 -
...好吧,如果您想重定向到另一个站点(如果我没看错的话),为什么不直接使用
a标签...?
标签: javascript reactjs react-router react-router-dom