You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[{
"resource": "****************************",
"owner": "typescript",
"code": "2322",
"severity": 8,
"message": "Type '(props: any) => ReactNode' is not assignable to type 'ReactNode'.",
"source": "ts",
"startLineNumber": 260,
"startColumn": 16,
"endLineNumber": 293,
"endColumn": 23,
"relatedInformation": [
{
"startLineNumber": 260,
"startColumn": 16,
"endLineNumber": 293,
"endColumn": 23,
"message": "Did you mean to call this expression?",
"resource": "*******"
}
]
}]
toastBC.current.show({
severity: 'success',
summary: 'Can you send me the report?',
sticky: true,
content: (props) => ( //the type error happen on here when you want to pass props in the content//
<div className="flex flex-column align-items-left" style={{ flex: '1' }}>
<div className="flex align-items-center gap-2">
<Avatar image="/images/avatar/amyelsner.png" shape="circle" />
<span className="font-bold text-900">Amy Elsner</span>
</div>
<div className="font-medium text-lg my-3 text-900">{props.message.summary}</div>
<Button className="p-button-sm flex" label="Reply" severity="success" onClick={clear}></Button>
</div>
)
});
I have fixed on my development by changing ToastMessage type content?: React.ReactNode | undefined; to content?: (props:any)=> React.ReactNode | undefined;
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
Typescript
Issue or pull request is *only* related to TypeScript definition
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Type: Bug
Issue contains a defect related to a specific component.
labels
Aug 11, 2024
Describe the bug
Typescript throw error
I have fixed on my development by changing ToastMessage type
content?: React.ReactNode | undefined;
tocontent?: (props:any)=> React.ReactNode | undefined;
Reproducer
No response
System Information
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: