<div
clName={`alert alert-${showAlert?.color} alert-fixed fade ${
showAlert ? "show" : "d-none"
}`}
role="alert"
style={{
width: "450px",
right: "1%",
top: "15%",
bottom: "unset",
left: "unset",
transform: "unset",
}}
>
<div clName="d-flex justify-content-between">
<strong>{showAlert?.msg}!</strong>
<on
type="on"
clName="btn-close"
onClick={() => setShowAlert(false)}
></on>
</div>
</div>
您可以使用将 useLocation 挂钩导入您的项目
import { useLocation } from "react-router-dom";
如果你想了解它,你可以使用这篇文章:
https://www.geeksforgeeks.org/react-router-hooks/本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(38条)