Initial issue reported in swagger-api/swagger-editor#5075
When refreshing the page in Swagger Editor, the specification is not retained. When updating the spec prop, the update is also not reflected. This happens due to the changes to logic that came with the swagger-ui-react component refactor.
We need to keep previous props as references and change the spec update condition to:
if (
spec &&
spec !== SwaggerUIConstructor.config.defaults.spec &&
(spec !== prevStateSpec || spec !== prevSpec)
)
Initial issue reported in swagger-api/swagger-editor#5075
When refreshing the page in Swagger Editor, the specification is not retained. When updating the
specprop, the update is also not reflected. This happens due to the changes to logic that came with theswagger-ui-reactcomponent refactor.We need to keep previous props as references and change the spec update condition to: