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

Add content property to Message component #1463

Closed
VsevolodGolovanov opened this issue Jul 20, 2020 · 1 comment
Closed

Add content property to Message component #1463

VsevolodGolovanov opened this issue Jul 20, 2020 · 1 comment
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@VsevolodGolovanov
Copy link

I'm submitting a ... (check one with "x")

[ ] bug report
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Codesandbox Case (Bug Reports)

Current behavior
The imperative Message API accepts custom markup for summary/detail, but if you use Message inline:

<Message severity="error" text="Field is required">

, then you only get the text property which is documented and typed as a string, not e.g. ReactNode (ts).
Message also doesn't render children.
In practice you can shove nodes into text:

<Message severity="error"
	//@ts-ignore
	text={<span>Test</span>} />

, and it works, but it should be a documented feature.

Expected behavior
Message should accept custom node content in some way, e.g. as children:

<Message severity="error"><span>Test</span></Message>

Minimal reproduction of the problem with instructions

Please tell us about your environment:

  • React version:
  • PrimeReact version:
    4.2.2

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
@mertsincan mertsincan changed the title Message: accept node content for inline usage Add content property to Message component Aug 21, 2020
@mertsincan mertsincan self-assigned this Aug 21, 2020
@mertsincan mertsincan added the Type: New Feature Issue contains a new feature or new component request label Aug 21, 2020
@mertsincan mertsincan modified the milestones: 5.0, 5.0-rc2 Aug 21, 2020
@mertsincan
Copy link
Member

The 'content' property can be a string, function(props) or JSX element.

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

2 participants