Why are props are not being passed to the following component? The value of percentage is coming out to be undefined. Any pointers will be helpful. Thanks
// selectors
const selectProgress = state => state.get('progress');
export const selectPercentage = () => createSelector(selectProgress, substate => substate.get('percentage'));
// Component
export const ProgressBar = ({ percentage }) => {
console.log('percentage ', percentage);
return <div>{percentage}</div>;
};
ProgressBar.propTypes = {
percentage: PropTypes.number,
};
export const mapStateToProps = createStructuredSelector({
percentage: selectPercentage(),
});
const withConnect = connect(mapStateToProps);
export default compose(withConnect)(ProgressBar);
}