소스 검색

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 5 년 전
committed by kyle
부모
커밋
f5a3d8854d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      src/core/components/curl.jsx

+ 1
- 1
src/core/components/curl.jsx 파일 보기

@@ -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>
)


불러오는 중...
취소
저장