Skip to content
Advertisement

Tag: reactjs

React rerender component on database change

Im trying to develop a dynamic todoList. I have two components TodoList, and Todo. TodoList fetches with useSWR the data from Mongo and puts the data in a div depending if they’re completed or not. Todo component has a button to mark if the task its completed or not. When you click the input check it changes automatically on mongo.

How can I put validation in react, that if I have choose an option from a drop down, then that option will be disable in the other drop down menu

I am designing a form in react in which I have two categories of dropdown. one is named as “What include” and the other is “What is not include”. Now I want that if the user to select any option from the menu of “What Include”, then that option(item) will be disabled in the other drop-down named “What not Include”.

Add object to array in class component

I have a list of products (unordered list which I apply at the beginning and it shows on screen) and after click on one of them for example: milk, app should add it on screen to list “to buy”. But it shows on the screen after I click on another element or second time on the first one. It also

Advertisement