Skip to content

Tag: reactjs

start and end date should be different for one year

Hi there I’m using Yup as a validator for one of my schemas This is my code here for validating schema This works but I can add the same date for the start date and end date. I want that end date to be different and higher than start date Thanks a lot Answer You can try Yup.when to handle

Any method to use single useState()

What I wanted to know ,that is there any method / technique to replace many useState() hook in one hook. Like, Instead of writing the whole thing again and again , we define it any one of them. Answer You can create a state object and use it. Note: When you set state, make sure you merge with the previous

Can I get a JSON object with name value?

I’m trying to make a Covid-19 tracker App by ReactJS. I want to get data that only an object (a specific province value) from JSON API with ProvinceChange event. Problem : I can’t get data that is only an object (a specific province value). what I tried : I tried a method filter using province.nam…

Prevent Event Listener firing event multiple times

I am using this event listener to fire an event which basically updates my state of Interval in a useEffect and enabling me to go up and down in my table. The up and down approach working fine for me but its firing the event multiple times. This multiple times firing of event causing the top and down events w…