Skip to content

Instantly share code, notes, and snippets.

View nidhidsharma08121988's full-sized avatar

Nidhi Sharma nidhidsharma08121988

  • Dubai
  • 16:26 (UTC -12:00)
View GitHub Profile
@elitan
elitan / ContactForm.js
Last active November 9, 2022 05:21
React Router V4 Redirect after form submission
import React, { Component } from 'react';
import { withRouter } from 'react-router-dom'; // <--- import `withRouter`. We will use this in the bottom of our file.
class ContactForm extends Component {
submitForm (e) {
e.preventDefault()
this.props.history.push('/thank-you'); // <--- The page you want to redirect your user to.
}