ES
Size: a a a
ES
E
E
SG
E
VK
VK
VK
fetch = async (id) => {
setLoading(true);const { type, content: documents } = await documentPassing(id);
}MY
SG
const [loading, setLoading] = useState(false)vs
const [documents, setDocuments] = useState([])
const fetch = id => {
setLoading(true)
...вызвать и обработать ответ
} finally {
setLoading(false)
}
}
const [{loading, value: documents = []}, fetch] = useAsyncFn(
id => {
...вызвать и обработать ответ
},
[]
)𝓡𝓕

Line 33:22: 'template' is not defined no-undef
V
YP
MY
{type === '' ?
...
:
...
}AE
𝓡𝓕
𝓡𝓕
𝓡𝓕
{type === 'тип 1' ?
...
type === 'тип 2'
...
:
...
}
?AZ