Lädt...


🔧 Can you find the error in this Nextjs code?


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Project Repo: https://github.com/kelsey-d/savings-calculator

I'm looking to enhance my understanding of React and Next.js through infamous beginner projects.

This one is a simple calculator that when given a savings goal as a target date it returns the balance at that date or if given as a target balance it will return the date the balance is reached.

It is a work in progress so please excuse its appearance. I will style it last. Right now I'm working on the logic. I am experiencing a bug.

Since the calculator has two modes "date" and "balance", I want only the relevant inputs, "Target Month" and "Target Balance" respectively, to show based on the mode chosen.

By default the "Target Month" is shown but the user can use the DATE and BALANCE buttons above the input to toggle between the two. However, when BALANCE is clicked the inputs are switched only momentarily before resetting back to "Target Month."

Can you find the error?

I can gather from the way I abused the useState hook it was a matter of time before something broke. It might be a re-render is resetting the state but I don't know which one.

Any feedback is appreciated but I am looking for any explanation of the bug and tips on better organization of state, functions and components.

Thank you!

...

🔧 Can you find the error in this Nextjs code?


📈 35.9 Punkte
🔧 Programmierung

🔧 KISS Principle: Giữ Mọi Thứ Đơn Giản Nhất Có Thể


📈 31.23 Punkte
🔧 Programmierung

🔧 Có thể bạn chưa biết (Phần 1)


📈 31.23 Punkte
🔧 Programmierung

🔧 Tìm Hiểu Về RAG: Công Nghệ Đột Phá Đang "Làm Mưa Làm Gió" Trong Thế Giới Chatbot


📈 31.23 Punkte
🔧 Programmierung

🔧 What is NextJs?  Why Should You Use it in 2023?  NextJs Pros and Cons Guide


📈 28.98 Punkte
🔧 Programmierung

🔧 3 Exciting Improvements Between NextJS 14 And NextJS 13


📈 25.79 Punkte
🔧 Programmierung

🔧 NextJS examples: 60 popular websites built with NextJS and headless CMS


📈 25.79 Punkte
🔧 Programmierung

🐧 "Find your way" helps you find ways you can help push Plasma Mobile towards version 1.0


📈 23.87 Punkte
🐧 Linux Tipps

🔧 Module not found can't resolve 'fs' Nextjs: Error Solution


📈 22.75 Punkte
🔧 Programmierung

📰 You can’t choose when you’ll be hit by ransomware, but you can choose how you prepare


📈 20.44 Punkte
📰 IT Security Nachrichten

🔧 12 things you didn't know you could do with Nextjs


📈 19.27 Punkte
🔧 Programmierung

🔧 Integrating a VS Code Like Editor in NextJS | Code Snippet Sharing App Series


📈 19.18 Punkte
🔧 Programmierung

🔧 Handling custom error responses from ExpressoTS with TanStack Query, and NextJS


📈 18.91 Punkte
🔧 Programmierung

🔧 hello, i have an issue with my nextjs it runs for some time then i see application error


📈 18.91 Punkte
🔧 Programmierung

📰 How to Fix Error 3, Error 7, and Error 60 in Microsoft Edge for Windows 10


📈 18.03 Punkte
📰 IT Security Nachrichten

📰 Can't find your car keys? Robots will remember better than you can


📈 17.7 Punkte
📰 IT Nachrichten

🪟 Windows 10 Can’t Find Printer: 7 Methods That You Can Use


📈 17.7 Punkte
🪟 Windows Tipps

📰 Why Uber Can Find You but 911 Can't


📈 17.7 Punkte
📰 IT Security Nachrichten

🐧 Someone help to find this. I forgot to laminate it and can't find it again.


📈 17.49 Punkte
🐧 Linux Tipps

📰 Apple’s New ‘Find My’ Can Find Your Devices Even When They’re Offline


📈 17.49 Punkte
📰 IT Security Nachrichten

matomo