Created
March 3, 2017 16:41
-
-
Save ericelsken/7928df35fc9f28f8253a1d3bc0d25827 to your computer and use it in GitHub Desktop.
This file contains 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, PropTypes } from 'react'; | |
export default class ClientDashboard extends Component { | |
static propTypes = { | |
clientId: PropTypes.string.isRequired, | |
client: PropTypes.object, | |
fetchClient: PropTypes.func.isRequired, | |
} | |
componentWillMount() { | |
this.props.fetchClient(this.props.clientId); | |
} | |
componentWillReceiveProps(nextProps) { | |
if (this.props.clientId !== nextProps.clientId) { | |
this.props.fetchClient(nextProps.clientId); | |
} | |
} | |
render() { | |
//return something displaying this.props.client. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment