Files
swagger-ui/src/core/components/clear.jsx
2017-06-29 04:37:19 +02:00

26 lines
599 B
JavaScript

import React, { Component } from "react"
import PropTypes from "prop-types"
export default class Clear extends Component {
onClick =() => {
let { specActions, path, method } = this.props
specActions.clearResponse( path, method )
specActions.clearRequest( path, method )
}
render(){
return (
<button className="btn btn-clear opblock-control__btn" onClick={ this.onClick }>
Clear
</button>
)
}
static propTypes = {
specActions: PropTypes.object.isRequired,
path: PropTypes.string.isRequired,
method: PropTypes.string.isRequired,
}
}