import { Link } from 'react-router-dom';
...
const Button = () => {
<Link to="SOME_S3_URL"/>
<button>Go to S3 URL</button>
</Link>
}
When I click it, it's not working. Is it possible to do so?
I guess SOME_S3_URL is referring to an URL to Amazon S3, which in that case, is outside of your application.
So you should use a normal <a/> instead since <Link /> is designed for internal navigation.
As for your comment about "creating a reusable button", you just apply CSS to the <a /> element so that it will look like a button. This is a common practice used by multiple popular UI libraries like MUI and Chakra UI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With