From 0ef06130200142b322546e62bb93d07e4689c6ae Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Thu, 16 Nov 2017 22:25:19 -0800 Subject: [PATCH] Remove Response update logic; dispatch changeProducesValue correctly --- src/core/components/response.jsx | 6 ------ src/core/components/responses.jsx | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/core/components/response.jsx b/src/core/components/response.jsx index b66d49b8..e839d405 100644 --- a/src/core/components/response.jsx +++ b/src/core/components/response.jsx @@ -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 }) diff --git a/src/core/components/responses.jsx b/src/core/components/responses.jsx index 408d4621..ea5ee486 100644 --- a/src/core/components/responses.jsx +++ b/src/core/components/responses.jsx @@ -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