This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
if(!startTimer && inpBoxSplit.length > 0){ | |
computeResult(); | |
} | |
},[startTimer, inpBoxSplit]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
if(timeInSeconds && paragraphArr.length > 0){ | |
setEligibleToStart(true); | |
} | |
},[timeInSeconds,paragraphArr]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
if(inputVal && !endTimer){ | |
setStartTimer(true); | |
} | |
},[inputVal]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const compare = () => { | |
if(inpBoxSplit[inpBoxSplit.length - 1] !== splitToArr[inpBoxSplit.length - 1]){ | |
const copyArr = paragraphArr.slice(); | |
copyArr[inpBoxSplit.length - 1] = <CreateSpanElements value={splitToArr[inpBoxSplit.length - 1]} index={inpBoxSplit.length-1} nameClass={-1} />; | |
setIncorrectEntry(prevState => ++prevState); | |
setParagraphArr(copyArr); | |
} | |
else{ | |
const copyArr = paragraphArr.slice(); | |
copyArr[inpBoxSplit.length - 1] = <CreateSpanElements value={splitToArr[inpBoxSplit.length - 1]} index={inpBoxSplit.length-1} nameClass={1} />; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
compare(); | |
}, [inpBoxSplit]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [inpBoxSplit, setInpBoxSplit] = useState<string[]>([]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
if(inputVal){ | |
const x = inputVal.split(''); | |
setInpBoxSplit(x); | |
} | |
},[inputVal]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
setParagraphArr(splitToArr.map((val,index) => <CreateSpanElements value={val} index={index} nameClass={0}/>)); | |
},[splitToArr]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [splitToArr, setSplitToArr] = useState<string[]>([]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
if(displayVal){ | |
setSplitToArr(displayVal.split('')); | |
} | |
}, [displayVal]); |
NewerOlder