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

143
Views
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 answers
Answer question

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 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!