Skip to content

Instantly share code, notes, and snippets.

@goldensunliu
Last active January 27, 2018 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goldensunliu/24ca7174f8bda201c0d8561b114727c1 to your computer and use it in GitHub Desktop.
Save goldensunliu/24ca7174f8bda201c0d8561b114727c1 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { fetchAudioFeaturesById } from '../actions';
import Artist from '../Artist'
const mapStateToProps = ...
const mapDispatchToProps = ...
class ConnectedArtist extends React.Component {
...
componentWillMount() {
const { fetchFullArtist, artistId } = this.props;
fetchFullArtist(trackId);
}
render() {
const { artist } = this.props
return (<Artist artist={artist}/>)
}
...
};
export default connect(mapDispatchToProps, dispatchToProps)(ConnectedArtist);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment