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

146
Vistas
Compiled with problems

I have a problem with react-router-dom and Prompt. The problem is Prompt' (imported as 'Prompt') was not found. Has something changed in the new versions?

Here is my code:

import React from 'react';
import '../styles/ContactPage.css';
import { Prompt } from 'react-router-dom';

class ContactPage extends React.Component {
    state = {
        value: ''
    }
    handleSubmit = e => {
        e.preventDefault();
        this.setState({
            value: '',
        })
    }
    handleChange = e => {
        this.setState({
            value: e.target.value,
        })
    }

    render() {
        return (
            <div className='contact'>
                <form>
                    <h3>Send a form</h3>
                    <textarea value={this.state.value} onChange={this.handleChange} placeholder='write something'></textarea>
                    <button onSubmit={this.handleSubmit}>Send</button>
                </form>
                <Prompt when={true} message={"You did not end your form. Are you sure you want to change a page? All data will be lost"} />
            </div>
        );
    }
}

export default ContactPage;
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The documentation has a guide for upgrading from v5 to v6 which says:

<Prompt> is not currently supported

<Prompt> from v5 (along with usePrompt and useBlocker from the v6 betas) are not included in the current released version of v6. We decided we'd rather ship with what we have than take even more time to nail down a feature that isn't fully baked. We will absolutely be working on adding this back in to v6 at some point in the near future, but not for our first stable release of 6.x.

Stick to v5 if you want to use it.

about 4 years ago · Juan Pablo Isaza Denunciar
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