如何在 react 上使用"a"链接作为外部链接,但也使用 react 传入道具?



如何使用'a'链接的外部链接上的反应,但也通过在一个prop使用反应?

<a
target={"_blank"}
href={`https://www.google.com/maps/dir//${this.props.business.lat},${this.props.business.lng}`}
>
Get Directions
</a>

我试着在生意上及格。晚上和生意。但它仍然连接到本地主机。如何设置它,让它只显示谷歌地图?

我复制粘贴到我的react项目,并按预期工作。当我移除"https://"从链接到localhost。你确定在你的项目中没有遗漏吗?

最新更新