LogoutButton.js 291 Bytes
Newer Older
이재연's avatar
이재연 committed
1
2
3
4
5
6
7
8
9
10
11
12
import React from 'react'
import {withRouter} from 'react-router-dom'

function LogoutButton({logout,history}){
    const handleClick = () =>{
        logout()
        history.push("/")
    }
    return <button onClick={handleClick}>Logout</button>
}

export default withRouter(LogoutButton)