Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
¿Cómo redirigir a otra página cuando se hace clic en el botón React js?

Estoy haciendo un mapa de Google con un botón de informe y no puedo entender cómo hacer que la página se redirija a otra página cuando se hace clic en el botón con la clase "informe-btn". Traté de usar pero no funcionó y no estoy seguro de cómo implementar esto.

 export class MapContainer extends Component { state = { showingInfoWindow: false, activeMarker: {}, selectedPlace: {}, }; onMarkerClick = (props, marker, e) => this.setState({ selectedPlace: props, activeMarker: marker, showingInfoWindow: true, }); onClose = (props) => { if (this.state.showingInfoWindow) { this.setState({ showingInfoWindow: false, activeMarker: null, }); } }; render() { return ( <Map google={this.props.google} zoom={14} style={mapStyles} initialCenter={{ lat: 40.75901, lng: -73.984474, }} > <Marker onClick={this.onMarkerClick} name={"S Train - 42 Street"} /> <InfoWindow marker={this.state.activeMarker} visible={this.state.showingInfoWindow} onClose={this.onClose} > <div> <h4>{this.state.selectedPlace.name}</h4> <button className="report-btn">Report</button> </div> </InfoWindow> </Map> ); } }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Tiene 2 solutions , use react-router-dom o window.location.href/replace

 import { Link, NavLink } from 'react-router-dom';
about 4 years ago · Juan Pablo Isaza Report

0

Deberías usar

 import { Link} from 'react-router-dom'; return ( <Link to={"/somewhereyoulike}> <Button> somthiong </Button> </Link> )
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!