Skip to content

Tag: javascript

How to use redux state data in a link?

I am new to redux and reactjs. I am trying to use a state data called type in the link I am fetching using axios in line no 17. I am setting the value of type from another .jsx file using dispatch(). Here in Home.jsx file I am calling dispatch in line no 24 for updating the state value type

How to check if number ends in .99

I’m attempting to do some validation a price field. I would like to check if the price entered into the price field ends in .99 I’ve attempted find posts about this but I can’t find examples for decimal numbers only whole numbers. I tried to check by doing price % 1 but it isnt consistent as…

Export some properties from the nested object

Let’s say there is an object that looks like this: Now I would like to export some of the nested values so that it can be used in various files across the app (exporting the entire object is not an option). What we could do is manually create all the required variables and export them like this: The pro…

(REACT JS) put value on 1 array element from component

I’m trying to give one component the array value at a certain index and assign a value that i want from the child component. I want it like this because I’m trying to do a survey app and the number of question can be different. this is just a little test that concludes what I want. the base Compon…

Can’t persist checkstate in reactjs and nodejs

This would be my first time of doing this and I can’t seem to find a way around it. I would like to persist check box state in react.js and would like this to be done without my MongoDB database. Here are my codes so far: I am fetching list of subscribers from my MongoDB database like this: This display…