250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- bitcoin
- express.js
- HTML
- 삶
- hardhat
- graphQL
- CLASS
- JavaScript
- middleware
- REACT
- Redux
- web
- evm
- 기준
- solidity
- blockchain
- typeScript
- tailwindcss
- SSR
- API
- concept
- node.js
- Interface
- nextJS
- CSS
- useState
- built in object
- error
- Props
- Ethereum
Archives
- Today
- Total
ReasonJun
Next.js : Stop scrolling after moving the page via 'router.push/replace ...' 본문
Frontend/Error
Next.js : Stop scrolling after moving the page via 'router.push/replace ...'
ReasonJun 2023. 7. 28. 02:38728x90
code:
Error not scrolling after navigating to '/User/Transactions/'
const onDelete = () => {
setLoading(true)
axios
.post('/api/delete/my-transaction', { transactionId: transactionId })
.then(() => {
toast.success('Complete deletion of transaction');
router.push('/User/Transactions/');
})
.catch((err) => {
toast.error(`Fail: The delete failed.`);
console.error(err);
}).finally(() => {
setLoading(false);
});
};
Why :
Due to a component working on the existing page. there was a button that moves with loading, but it is a factor that fixes the screen as much as it existed in the modal(screen fixed).
solution :
Remove the code that causes the loading behavior and replace the visual info with toast.
code:
728x90
'Frontend > Error' 카테고리의 다른 글
React: useState react one beat slower error (0) | 2023.07.31 |
---|---|
React : useForm lig error <button> (0) | 2023.07.30 |
Can I use 'useState' in an async function in 'Nextjs'? (0) | 2023.07.10 |
Next.js : Module not found: Can't resolve 'fs' (0) | 2023.06.19 |
'React' refers to a UMD global, but the current file is a module. Consider adding an import instead. (0) | 2023.06.17 |
Comments