Skip to content

Instantly share code, notes, and snippets.

@furkankadioglu
Created June 3, 2017 20:52
Show Gist options
  • Save furkankadioglu/4611b7fef227dd7a522ed339c0f3ef44 to your computer and use it in GitHub Desktop.
Save furkankadioglu/4611b7fef227dd7a522ed339c0f3ef44 to your computer and use it in GitHub Desktop.
React - Communication
import React, { Component } from 'react';
import Switcher from './components/Switcher';
import './components/Switcher.css';
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.state = { trackingStatus: true };
}
trackingStatusUpdate(data)
{
console.log(data);
}
render() {
return (
<div className="App">
<Switcher trackingStatus={this.state.trackingStatus} trackingStatusUpdate={this.trackingStatusUpdate} />
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment