Created
January 27, 2017 20:25
-
-
Save iamkevingreen/8d04c63c16e1f820ec42429e93906d8c to your computer and use it in GitHub Desktop.
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' | |
export default class Layout extends Component { | |
constructor(props) { | |
super(props) | |
} | |
render() { | |
let children = null; | |
if (this.props.children) { | |
children = React.cloneElement(this.props.children, { | |
auth: this.props.route.auth //sends auth instance from route to children | |
}) | |
} | |
return ( | |
<div className="app"> | |
{children} | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment