Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

232
Vistas
How can I access data on another page?

On submission of the form, I want to pass the state of UserLocation and form data to another page where I can access it.

rows is an array of excel sheet rows fetched from an API

I am receiving this error

DataCloneError: Failed to execute 'pushState' on 'History': Storage object could not be cloned.

I am receiving this error

The code of the file is:

class UserLocation extends React.Component {
  constructor(props) {
    super(props);
    this.state = {value: '',data:[]};

    this.handleChange = this.handleChange.bind(this);
    this.handleSubmit = this.handleSubmit.bind(this);

  }

  handleChange(event) {
    this.setState({value: event.target.value});
  }

  handleSubmit(event) {
    event.preventDefault();
    this.setState({value: event.target.value});
  }
  
  componentDidMount(){
    getRow(){
     //rows fetched from an API
     this.setState({data:rows});
    }
    getRow();
  }

  render() {
    return (
      <div className="District">
        <div className="DistrictBar">
          <form onSubmit={this.handleSubmit}>
            <label>
              Enter District:
              <input type="text" value={this.state.value} onChange={this.handleChange} />
            </label>
            <Link to={{pathname:"/district",state:{state:window.localStorage}}}><button><input type="submit" value="Submit" /></button></Link>
          </form>
          </div>
      </div>
    );
  }
}

export default UserLocation;
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda