Is there any way to set the props of the parent from child to parent?
At the moment I have taken the property but I want to manipulate it.
Exist something likethis.setProps
or I don't know in React in the same way we have {this.setState}
?
Thank you.
Asked
Active
Viewed 57 times
1

user3678528
- 1,741
- 2
- 18
- 24

Xhino Agalliu
- 23
- 5
-
You can pass a setter function to child and child can pass new value to it – Rajesh Sep 02 '16 at 10:32
-
1you can check out here : http://stackoverflow.com/questions/22639534/pass-props-to-parent-component-in-react-js – Vishnu Shekhawat Sep 02 '16 at 10:33
-
It worked that way,thank you @Rajesh – Xhino Agalliu Sep 02 '16 at 10:48
-
@XhinoAgalliu Ideally you component should not know the world outside it. All it should know is on a specific event, if you have a prop, you should call it. – Rajesh Sep 02 '16 at 10:54