Skip to content

Tag: reactjs

(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…

Controlled from in React

I’m new in react and I’m a bit confused about how React runs update on every new input’s keystroke, for exapmpe, this is the form and I want to update the state on every keystroke What I don’t understand here is the update cycle, my understanding is the following: As the input’s …

Type json in React components

I have a dynamic json, for example: And I created interface for this: I have two components: But this return me error: Type “IResult” is not assignable to type ‘string’. in line: <SecondComponent result={result}> What I’m doing wrong? Answer When you pass arguments to a com…