Skip to content

Tag: reactjs

Widen Image on scroll down using React

I want an image animation effect while scrolling using react.js, something similar to this : https://www.roche.com/ I have this code : I want the img to be widen animated while scrolling down and returns to normal when scrolling up ! Thanks. Answer One of the possible solutions with runnable example This is o…

useState executing before another function

I am trying to setRes() as respond which is the result for a login request but Res is not setting This is the function: respond should return an object like this : or I tried console.log() for respond and the result is correct but the setRes(respond) is not working. Any ideas? The jsx: is this the correct way…

How to map data that we get from database to UI?

I have a Redux action function called getAllJob which is supposed to get all jobs informations (title and description) from database: Now i need to map this response.data.data to UI to be rendered so i get a list of jobs with titles and descriptions for each one from database. For that, i tried the below code…

Hidden password only works in one input box

I have this JS code that shows 2 input boxes that asks for a password: 1) Password 2) Confirm Password. However, the clickShowPassword() is only connected to Password. [Output] [1]: https://i.stack.imgur.com/IZoa3.png Here’s my whole js file that is connected to an react application. Answer In your seco…

Change object label on specific value in js

I’m working on charts in React.js and i want to display data sorted by month. In django i’ve created view for displaying json with total events per month and it looks like this: I would like to sort every object in that array and change value ‘month’ from numbers to month name, so it w…