Say i have an user
object and need to pass it into a custom component which extends Button component:
CustomButton.component({user});
// trying to show both avatar & username in a button
export default class CustomButton extends Button {
getButtonContent() {
const user = this.props.user;
return [
avatar(user),
<span className="Button-label">{username(user)}</span>
];
}
}
It is working that way but <button user=[object object] />
attribute lies on the source code. What is the proper way of doing this?