Skip to content

Instantly share code, notes, and snippets.

View SivanKarthick's full-sized avatar
💭
React JS Developer

Karthick Sivan SivanKarthick

💭
React JS Developer
  • Hinduja Tech
  • Chennai
View GitHub Profile
@SivanKarthick
SivanKarthick / ParentChild.es6
Created July 19, 2019 15:13 — forked from sebkouba/ParentChild.es6
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);