Skip to content

Instantly share code, notes, and snippets.

@iamkevingreen
Created January 27, 2017 20:25
Show Gist options
  • Save iamkevingreen/8d04c63c16e1f820ec42429e93906d8c to your computer and use it in GitHub Desktop.
Save iamkevingreen/8d04c63c16e1f820ec42429e93906d8c to your computer and use it in GitHub Desktop.
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