Skip to content

Instantly share code, notes, and snippets.

@sebkouba
sebkouba / ParentChild.es6
Created February 17, 2016 06:00
Basic example to pass values between parent and child components in React.
/**
* Basic example to pass values between parent and child components in React
* Seems to be in line with this
* http://stackoverflow.com/questions/24147331/react-the-right-way-to-pass-form-element-state-to-sibling-parent-elements
* Now I have the state in parent and child. Is that good or bad? Why would I need it in child?
* Could probably take that out
* */
class Parent extends React.Component {
constructor(props) {
super(props);