Add shouldComponentUpdate to response.jsx and live-response.jsx. Remove isShownKey from shouldComponentUpdate of OperationContainer. Moved response and request out to separate props for operation.jsx. Removed unused request prop from responses.jsx.
This commit is contained in:
@@ -98,7 +98,7 @@ export default class OperationContainer extends PureComponent {
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
return this.state.tryItOutEnabled !== nextState.tryItOutEnabled
|
||||
const render = this.state.tryItOutEnabled !== nextState.tryItOutEnabled
|
||||
|| this.state.executeInProgress !== nextState.executeInProgress
|
||||
|| this.props.op !== nextProps.op
|
||||
|| this.props.tag !== nextProps.tag
|
||||
@@ -107,7 +107,6 @@ export default class OperationContainer extends PureComponent {
|
||||
|| this.props.operationId !== nextProps.operationId
|
||||
|| this.props.showSummary !== nextProps.showSummary
|
||||
|| this.props.isShown !== nextProps.isShown
|
||||
|| this.props.isShownKey !== nextProps.isShownKey
|
||||
|| this.props.jumpToKey !== nextProps.jumpToKey
|
||||
|| this.props.allowTryItOut !== nextProps.allowTryItOut
|
||||
|| this.props.displayOperationId !== nextProps.displayOperationId
|
||||
@@ -115,6 +114,7 @@ export default class OperationContainer extends PureComponent {
|
||||
|| this.props.response !== nextProps.response
|
||||
|| this.props.request !== nextProps.request
|
||||
|| this.props.isDeepLinkingEnabled !== nextProps.isDeepLinkingEnabled
|
||||
return render
|
||||
}
|
||||
|
||||
toggleShown =() => {
|
||||
@@ -177,7 +177,6 @@ export default class OperationContainer extends PureComponent {
|
||||
isShownKey,
|
||||
jumpToKey,
|
||||
allowTryItOut,
|
||||
response,
|
||||
request,
|
||||
displayOperationId,
|
||||
displayRequestDuration,
|
||||
@@ -189,6 +188,8 @@ export default class OperationContainer extends PureComponent {
|
||||
return (
|
||||
<Operation
|
||||
operation={operationProps}
|
||||
response={response}
|
||||
request={request}
|
||||
|
||||
toggleShown={this.toggleShown}
|
||||
onTryoutClick={this.onTryoutClick}
|
||||
|
||||
Reference in New Issue
Block a user