daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Nov 9th, 2018 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from 'react';
  2. import { Redirect, Link } from 'react-router-dom';
  3. import style from './nav-button.css';
  4.  
  5. class NavButton extends Component {
  6.     constructor(props) {
  7.         super(props);
  8.         this.state = { redirect: false };
  9.     }
  10.  
  11.     click = () => {
  12.         this.setState({redirect: true})
  13.     }
  14.  
  15.     render() {
  16.         if (this.state.redirect) {
  17.             return <Redirect to={this.props.nav} />
  18.         }
  19.  
  20.         return (
  21.           <button className={style.NavButton} onClick={this.click}>
  22.                 {this.props.label}
  23.           </button>
  24.       );
  25.     }
  26.   }
  27.  
  28. export default NavButton;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top