FileUpload: PT not passed to internal Messages component in advanced mode
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- react
- Domain
- frontend
Research direction
Start in components/lib/fileupload/FileUpload.js at createAdvanced around line 678, then compare its internal Messages rendering with createBasic around line 742. Use the linked StackBlitz reproducer and verify that the fileupload.messages Pass-Through configuration styles or hides the Messages component in advanced mode without affecting other Messages instances.
Written by the indexing model from the issue text.
Description
Describe the bug
In advanced mode, the FileUpload component renders an internal component without forwarding the pt prop via ptm('messages'). This makes it impossible to style or hide the Messages via the nested Pass-Through pattern (pt.fileupload.messages).
The global pt.messages workaround works but is unscoped — it affects every instance in the application, not just the one inside FileUpload.
Source reference
In fileupload.js (createAdvanced, ~line 678), the Messages component is rendered without pt:
<Messages ref={messagesRef} __parentMetadata={{ parent: metaData }} />
In contrast, createBasic (~line 742) correctly passes it:
<Messages ref={messagesRef} pt={ptm('message')} __parentMetadata={{ parent: metaData }} />
Reproducer
https://stackblitz.com/edit/vitejs-vite-rkgm9vfm?file=src%2FApp.tsx
System Information
System:
OS: Windows 11 10.0.26200
CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-1370P
Memory: 10.13 GB / 31.66 GB
Binaries:
Node: 24.14.0 - C:\Program Files\nodejs\node.EXE
npm: 11.9.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 149.0.7827.55
Edge: Chromium (140.0.3485.54)
Firefox: 151.0.3 - C:\Program Files\Mozilla Firefox\firefox.exe
Internet Explorer: 11.0.26100.8115
npmPackages:
primereact: ^10.9.7 => 10.9.7
react: ^19.2.3 => 19.2.3
tailwindcss: ^4.1.18 => 4.1.18
Steps to reproduce the behavior
import { PrimeReactProvider } from "primereact/api";
import { FileUpload } from "primereact/fileupload";
const pt = {
fileupload: {
messages: {
root: { className: "hidden" },
},
},
};
export default function App() {
return (
<PrimeReactProvider value={{ unstyled: true, pt }}>
<FileUpload
mode="advanced"
accept="image/*"
maxFileSize={100000}
/>
</PrimeReactProvider>
);
}
- Select a file that exceeds maxFileSize
- Observe that the internal Messages component still renders with default classes (
my-4 rounded-md) - The PT configuration has no effect
Expected behavior
The messages PT section inside fileupload should be applied to the internal component, allowing it to be styled or hidden.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from primefaces/primereact
-
Status: Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primefaces/primereact#8552 ·
-
Status: Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
primefaces/primereact#8545 ·
-
dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primefaces/primereact#8537 ·
-
Status: Needs Triage
Difficulty 3/5 1-2 days Newbie friendliness 58/100
primefaces/primereact#8551 ·
-
Status: Needs Triage
Difficulty 3/5 1-2 days Newbie friendliness 65/100
primefaces/primereact#8549 ·
All issues in primefaces/primereact
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug ready-for-dev
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 92/100