I am passing Button component as props of Toast component, so my custom button will be displayed inside toast component. If I click on button I need to call a method inside Toast component.
Toast usage:
const customActionButtonTemplate = (
<Mybutton label="Hide" onClick={// Here I wan t to call Toast components hideToast method//} />);
<Toast (...args)
customActionButtonTemplate = {customActionButtonTemplate()} />
Toast component:
export const Toast.FC<ToastInuts> = (props: ToastInputs ) => {
const hideToast(): void => {
//toast clicked
}
return (
<div>
<div>
//contents
</div>
<div>
{props.customActionButtonTemplate}
</div>
</div>
)
};