Home > Net >  How to use 'a' link for external link on react but also passing in a prop using react?
How to use 'a' link for external link on react but also passing in a prop using react?

Time:01-01

How to use 'a' link for external link on react but also passing in a prop using react?

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

Im trying to pass in business.lat and business.lng. but its still linking to local host. how do i set it so it goes to just google maps?

CodePudding user response:

I copy pasted that to my react project and that works as expected. When I removed "https://" from the link it goes to localhost. Are you sure you didn't miss that in your project?

  • Related