(e)
| 18 | }; |
| 19 | |
| 20 | const handleScroll = (e) => { |
| 21 | console.log(e.target.documentElement.scrollTop); |
| 22 | console.log(window.innerHeight); |
| 23 | console.log(e.target.documentElement.scrollHeight); |
| 24 | // console.log( |
| 25 | // Math.ceil(e.target.documentElement.scrollTop + window.innerHeight) |
| 26 | // ); |
| 27 | const scrollHeight = e.target.documentElement.scrollHeight; |
| 28 | const currentHeight = Math.ceil( |
| 29 | e.target.documentElement.scrollTop + window.innerHeight |
| 30 | ); |
| 31 | if (currentHeight + 1 >= scrollHeight) { |
| 32 | loadTenPokemon(); |
| 33 | } |
| 34 | }; |
| 35 | |
| 36 | useEffect(() => { |
| 37 | loadTenPokemon(); |
nothing calls this directly
no test coverage detected