Ver a proveniência

fix: React warning related to "true" used as boolean (via #5497)

This should fix this warning seen in the console when using `swagger-ui-react`:

```
Warning: Received the string `true` for the boolean attribute `readOnly`. Although this works, it will not work as expected if you pass the string "false". Did you mean readOnly={true}?
    in textarea (created by Curl)
    in div (created by Curl)
    in div (created by Curl)
    in Curl (created by LiveResponse)
    in div (created by LiveResponse)
    in LiveResponse (created by Responses)
```

I did not test this change because it's trivial and there is no behavioural change here, React treats non-empty string attributes as `true`.
bubble
silverwind há 5 anos
committed by kyle
ascendente
cometimento
f5a3d8854d
1 ficheiros alterados com 1 adições e 1 eliminações
  1. +1
    -1
      src/core/components/curl.jsx

+ 1
- 1
src/core/components/curl.jsx Ver ficheiro

@@ -20,7 +20,7 @@ export default class Curl extends React.Component {
<div>
<h4>Curl</h4>
<div className="copy-paste">
<textarea onFocus={this.handleFocus} readOnly="true" className="curl" style={{ whiteSpace: "normal" }} value={curl}></textarea>
<textarea onFocus={this.handleFocus} readOnly={true} className="curl" style={{ whiteSpace: "normal" }} value={curl}></textarea>
</div>
</div>
)


Carregando…
Cancelar
Guardar