I'm trying to redirect users to external links but the following code is always
<a href={`"https://"${posts.ctaURL1}`}
redirecting users to http://localhost:8080/%22https://%22www.fb.com
The external link won't be necessary https it can be http as well and url is dynamically filled. How to solve this issue?
It seems that posts.ctaURL1 also contains https, so that's why you get such a strange url. You could try
<a href={posts.ctaURL1}>click here</a>
If you want to replace https with http you can use string replace.
let url = posts.ctaURL1.replace("https", "http")
<a href={url}>click here</a>