Remove Response update logic; dispatch changeProducesValue correctly

This commit is contained in:
Kyle Shockey
2017-11-16 22:25:19 -08:00
parent d28bf86129
commit 0ef0613020
2 changed files with 2 additions and 8 deletions

View File

@@ -58,12 +58,6 @@ export default class Response extends React.Component {
onContentTypeChange: () => {}
};
shouldComponentUpdate(nextProps) {
return this.props.code !== nextProps.code
|| this.props.response !== nextProps.response
|| this.props.className !== nextProps.className
}
_onContentTypeChange = (value) => {
const { onContentTypeChange, controlsAcceptHeader } = this.props
this.setState({ responseContentType: value })

View File

@@ -28,7 +28,7 @@ export default class Responses extends React.Component {
shouldComponentUpdate(nextProps) {
// BUG: props.tryItOutResponse is always coming back as a new Immutable instance
let render = this.props.tryItOutResponse !== nextProps.tryItOutResponse
let render = this.props.tryItOutResponse !== nextProps.tryItOutResponse
|| this.props.responses !== nextProps.responses
|| this.props.produces !== nextProps.produces
|| this.props.producesValue !== nextProps.producesValue
@@ -38,7 +38,7 @@ export default class Responses extends React.Component {
return render
}
onChangeProducesWrapper = ( val ) => this.props.specActions.changeProducesValue(this.props.path, this.props.method, val)
onChangeProducesWrapper = ( val ) => this.props.specActions.changeProducesValue([this.props.path, this.props.method], val)
onResponseContentTypeChange = ({ controlsAcceptHeader, value }) => {
const { oas3Actions, path, method } = this.props