mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-06-15 18:08:15 +08:00
Don't display arrows with only one error.
This commit is contained in:
11
packages/react-dev-utils/failFast.js
vendored
11
packages/react-dev-utils/failFast.js
vendored
@@ -185,13 +185,16 @@ let viewIndex = -1
|
||||
let frameSettings = []
|
||||
|
||||
function renderAdditional() {
|
||||
let text = ' '
|
||||
if (capturedErrors.length > 1) {
|
||||
text = `Errors ${viewIndex + 1} of ${capturedErrors.length}`
|
||||
}
|
||||
if (additionalReference.lastChild) {
|
||||
additionalReference.removeChild(additionalReference.lastChild)
|
||||
}
|
||||
|
||||
let text = ' '
|
||||
if (capturedErrors.length <= 1) {
|
||||
additionalReference.appendChild(document.createTextNode(text))
|
||||
return
|
||||
}
|
||||
text = `Errors ${viewIndex + 1} of ${capturedErrors.length}`
|
||||
const span = document.createElement('span')
|
||||
span.appendChild(document.createTextNode(text))
|
||||
const group = document.createElement('span')
|
||||
|
||||
Reference in New Issue
Block a user