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 | 29 | 30 | 31 |
Tags
- CSS
- web
- 기준
- express.js
- typeScript
- concept
- REACT
- built in object
- solidity
- middleware
- HTML
- CLASS
- blockchain
- Ethereum
- Props
- error
- hardhat
- SSR
- node.js
- nextJS
- tailwindcss
- JavaScript
- evm
- useState
- graphQL
- API
- Interface
- bitcoin
- 삶
- Redux
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