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…
Tag: reactjs
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…
React firebase doesn’t await
I want to get data from firebase and map it and render a table with it but the firebase function returns data after the page loads. now if I make a var here let’s say var text= datas and console.log it it will return undefined the feed var is just some dummy text is there any way to make the
React.js: How to change icon when item in the list is clicked?
I’m trying to implement a logic, where based on clicked item, arrow down icon changes to arrow-up and if user clicks 2nd time to the same row should again change. I tried to trigger it based on the index of clicked item, but doesn’t work properly. Also tried to change the icons based on boolean st…
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…
Overflow-x scroll doesn’t work properly on mobile
https://codesandbox.io/s/frosty-water-fintki As you can see in attached sandbox I have a scrollable div with 6 items aligned in 2 rows. But when you switch to mobile view (toggle responsive view button near sandbox url input) it starts scrolling vertically. I’ve noticed, that if you remove flex-wrap it …
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…
React – Invalid hook call when calling useTranslation for react-i18next
I’m new to React Native and I’m trying to add translation in my navigation. In any other page it goes fine but not in my navigation. My i18n.js My StackNavigators.js What I’m trying to do is to add translation in BottomTabBar as title of each BottomNavigationTab and when I add const { t, i18…
Trying to use CSS statements with function-like formatting in JSS but I get an error
I’ve been recently trying to use JSS in my React project. My code is of a button that requires the transformY() property as an animation when you hover but it isn’t working. This is my code and the errors I receive when compiling. Line 7:24: ‘translateY’ is not defined no-undef Line 13…