Looks like you have created an internal function but forgot to call it. You have to call it or nothing happened:
useEffect(() => {
// call it
handleSecondWindowType();
function handleSecondWindowType () {
if (accepted_file.type.includes('image/')) {
setWin("A-Type")
}
else {
setWin("B-Type");
}
}
},[accepted_file]);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…