From f23be7d8f52d22892122fbf512fe9bccaa5b3cf7 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 20 Apr 2018 15:59:46 -0700 Subject: [PATCH] use Object.assign to always ensure setState receives a new value object --- src/core/plugins/oas3/components/http-auth.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/plugins/oas3/components/http-auth.jsx b/src/core/plugins/oas3/components/http-auth.jsx index af7dda84..5df10ddf 100644 --- a/src/core/plugins/oas3/components/http-auth.jsx +++ b/src/core/plugins/oas3/components/http-auth.jsx @@ -33,12 +33,10 @@ export default class HttpAuth extends React.Component { let { onChange } = this.props let { value, name } = e.target - let newValue = this.state.value || {} + let newValue = Object.assign({}, this.state.value) + if(name) { newValue[name] = value - if(newValue.set) { - newValue = newValue.set(name, value) - } } else { newValue = value }