Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the type of content property in ToastMessage #1761

Closed
prakash1998 opened this issue Jan 18, 2021 · 2 comments
Closed

Change the type of content property in ToastMessage #1761

prakash1998 opened this issue Jan 18, 2021 · 2 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@prakash1998
Copy link

[-] feature request

It will be good, if message.content property of ToastMessage component also support functional component along with ReactElement

currently it supports

content : <div>component</div>

better if it can also support

content : ({ close }) => <div>component</div>

it will provide more flexibility when user need to render custom component inside toast

i would like to submit pull request if needed, please respond me if you like to have this feature

@mertsincan mertsincan self-assigned this Jan 27, 2021
@mertsincan mertsincan changed the title Support for functional component as content with "close" as prop in ToastMessage Change the type of content property in ToastMessage Jan 27, 2021
@mertsincan mertsincan added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Jan 27, 2021
@mertsincan mertsincan added this to the 6.0.1 milestone Jan 27, 2021
@prakash1998
Copy link
Author

prakash1998 commented Feb 8, 2021

hey it will be helpful if you pass close as prop of functional component like..

  const contentEl = ObjectUtils.getJSXElement(content, {
    ...this.props,
    close: this.onClose
  })

@mertsincan
Copy link
Member

Fixed in #1805. You can use onClose callback for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants