Open
Description
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:
import * as React from "react";
import "filepond/dist/filepond.min.css";
import { FilePond } from "react-filepond";
export default class MyComponent extends React.PureComponent {
render() {
return (
<div>
<FilePond allowMultiple={false}
onprocessfile={this.onProcessFile}
onprocessfilestart={this.onProcessFileStart}
beforeAddFile={this.beforeAddFile}
server={{
process: {
url: "/api/scratchpad/from_file",
method: "POST",
withCredentials: true,
headers: {},
onload: this.onLoad,
onerror: this.onError,
ondata: this.onData
}
}} />
</div>
);
}
}
Expected behaviour
It should have the styled loaded before rendering the component so that there isn't a flicker.
Additional information
Environment | Version |
---|---|
OS | Linux |
Device | Laptop |
Browser | Chrome |