我需要一些帮助。我有一个图标,我希望当我按下该图标时可以转到其他页面,但我收到此错误 Error: Invariant failed: You should not use <Link> outside a <Router>
Error
这是我的代码:
import React from 'react';
import { IconContext } from "react-icons";
import { BsFileEarmarkArrowDown } from "react-icons/bs";
// import { Link } from "react-router-dom";
import "./icon.css"
const Question = () => {
return (
<IconContext.Provider value={{ color: "Green", className: "Icon", size:"3em" }}>
<BsFileEarmarkArrowDown />
</IconContext.Provider>
);
};
// export default function Firms() {
// return (
// <Link to="/Upload.js">
// <Question />
// </Link>
// );
// }
export default Question
缥缈止盈
呼啦一阵风
HUX布斯
相关分类