Skip to content

Issue downloading string as text file

I am trying to download data gotten from a GET request as a .txt file but I keep getting ‘undefined’ as the content of the downloaded file. I only need the data portion of the response. A sample response is provided below as well as my redux action, reducer and my export function My action: my red…

To find Next element data-id of list in JQuery

How to get the data-id of next list element from the current active list element on button click? The next element data-id need to be shown till the last (third) li. Answer You can find next li with .next(‘li’) and find its attribute data-id value with .attr(‘data-id’). Remove active c…

React UseState truthy/falsy

I’m trying to initialize some state for my form component with data from the redux store. If the shippingAddress object is null, I want to set properties of formData object to empty strings. Not sure how to get it to work. Currently I am receiving an error message saying TypeError: Cannot read property …