Last active
March 7, 2017 22:55
-
-
Save Kosmin/091b55905bfb6b4d70fb1c15f1e237e3 to your computer and use it in GitHub Desktop.
React Container Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component }, from 'react'; | |
class Container extends Component { | |
render() { | |
console.log('rendering Container'); | |
return ( | |
<div> | |
<Car details={this.props.firstCarDetails} /> | |
<Car details={this.props.secondCarDetails} /> | |
</div> | |
) | |
} | |
} | |
const firstCarDetails = {name: 'BMW', color: 'black'}; | |
const secondCarDetails = {name: 'KIA', color: 'red'}; | |
export <Container {firstCarDetails, secondCarDetails} /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment