Hi there, could someone help me with the following problem please?
Not sure to why it says renderAction is not defined when I added a renderAction method just underneath the Track class?
Thank you in advanced
import React from 'react';
import './Track.css';
class Track extends React.Component {
renderAction() {
if (this.props.isRemoval) {
return <button className="Track-action">-</button>
} else {
return <button className="Track-action">+</button>
}
}
render() {
return (
<div className="Track">
<div className="Track-information">
<h3>{this.props.track.name}</h3>
<p>{this.props.track.artist} | {this.props.track.album}</p>
</div>
{renderAction()}
{/*Added a dynamic button that displays a negative or a positive based on the value of the prop isRemoval that will be passed down to this component*/}
</div>
)
}
}
export default Track;