Skip to content

Tag: javascript

dispatching actions on every render

I am dispatching action addProducts on every mount of the ProductList component whereas i want to dispatch the action one timeusing useEffect hook and store the data in the redux and then use it. Below are my actions file and ProductList component file. actions.js file ProductList.js component file Answer You…

How to display array in Callback Function

I still confuse about callback function. I have a task to displays month using callback function, so I try to call my function getMonth for displays month and this is so far I got. I haven’t used Javascript before, so any help would be appreciated my output is: Answer You are assigning a function to set…

LinearGradient and onPress for navigation

so I am new to react native and know the basics about using onPress with buttons but since I have changed my button to this LinearGradient code below, I am kind of lost using onPress. Right now I only have onPress outputting to my terminal just to test and make sure its working. In the end I want to navigate

Replace string for specific key in multilevel Javascript array

As the title mention, I want to replace the values of a particular key in a javascript object. Sample Array – Value to be replaced key is title and value stack with stackoverflow anywhere in the array. I already google and tried many solutions but didn’t get the proper solution for this. Any refer…