-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Flash of unstyled content (FOUC) #110
Comments
Maybe this is because it first checks for support and otherwise falls back to a file input? |
After looking at the code I was thinking it's actually because the rendering happens in this order:
Thus the DOM has an unstyled input element in between these two things |
PR is welcome |
I thought about it a little but for my part I'm just going to work around this by moving it to a part of the UI where it isn't immediately visible. Here's my thoughts in case it helps someone else: One option would be to hide the component until the Filepond A real solution would be to fully create the desired DOM element(s) in the React |
Has this been addressed yet? |
i did sth like this : export default function FileUpload({ chatId, addDocument }: FileUploadProps) {
} |
Summary
The
react-filepond
component has a flash of unstyled content for me when it first comes up. This happens when I'm using React server-side rendering. It's happened for me when using both Gatsby.js and Next.js.Here's a recording of me refreshing the page to show it:
How to reproduce
Just use the
Filepond
component in a SSR-ed app. I'm using it exactly like the example in this repo does. Here's a simplified version of my component:Expected behaviour
It should have the styled loaded before rendering the component so that there isn't a flicker.
Additional information
The text was updated successfully, but these errors were encountered: