Skip to content
Advertisement

Tag: react-hooks

Reactjs: How to add delete icon?

In my project, there is an input field to add email values. Here added chips to convert the added items to tags. but I don’t know how to add the “X” delete button inside each tag I am a beginner in reactjs. I don’t know if there is any problem while using chips component so please give me valuable solutions

why console.log inside the useEffect runs twice

i’m currently working with react project, which gets data from api and show it on the console. although i wrote the console.log() just one time inside the useEffect hooks (with the [articles] dependency ), the web browser’s console.log always shows the console.log two times like this: enter image description here but i don’t know reason why.. in my thought when

Defining hooks inside an array

I would like to create a bunch of filters to pause or play my Video. My implementation is something like as shown below: I know defining hooks inside an if condition is not correct. But how about defining them as above? Could it be done in a better way? Answer In order for React to correctly preserve the state of

Advertisement