We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- React
- Forms
- Employee Validation
- Discussions
Employee Validation
Employee Validation
Sort by
recency
|
65 Discussions
|
Please Login in order to post a comment
Tests are invalid as they use an old date and isn't a true comparison against
today = new Date()Use this to pass failed tests because of wrong date
Adjusted the time to pass test as the date is old.
I don't know why people are using useEffect or useReduce, but my following code with only useState is working:
Note: the day of today in the problem is 12/31/2024 instead of the actual date of today.
A much simpler implementation without useEffect. This is using useReducer which is much preferred in cases like creating forms.