swagger-api / swagger-editor

Swagger Editor

Home Page:https://editor.swagger.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SwaggerEditor@next: readonly mode set via prop override

char0n opened this issue · comments

Readonly mode is managed via a redux state. But, it's also possible to pull an Editor component out from the system and pass it isReadOnly prop explicitly.

  const Editor = getComponent('Editor', true);

  <Editor isReadOnly />
  <Editor />

If passing the explicit isReadOnly prop is used, the prop is ignored and the redux state is always preferred.


The goal of this issue is to always prefer theisReadOnly prop if passed explicitly + overriding the redux state with the vlaue of the prop.

Addressed in #4977