Minimal Frontend Setup
Display lists of files and folders, and add an uploader
Component Setup
Below you can find a relatively simple FileBrowser
component
that displays your files and folders aswell as an upload dropzone.
While this code can get your component set up quickly, it's highly recommended that you check out the other components Filenest has to offer. You should check out the docs for each individual component to learn which render props, state and other info you can access in your JSX.
This code does not include things like loading states or delete buttons.
If you are looking for a complete component with loading states et cetera, you can check out these examples.
createFilenestComponents
endpoint
This property defines the parent endpoint for all Filenest API routes. Below are some examples:
/api/filenest
/api/media
http://localhost:3000/api/filenest
https://api.example.com/files
onUserInteractionRequired
This function will be called whenever the user needs to confirm a potentially dangerous action, for example the deletion of a folder with content inside.
At the very least you should show the default browser confirm dialog:
But you could also handle your own state and display a custom dialog or something else.