Highlights
🚀 New Features
- Full TypeScript support: The entire SDK has been rewritten from JavaScript/JSX to TypeScript/TSX. Type declaration files (.d.ts) now ship directly in the package, so you get autocomplete and type safety out of the box (no
@types/filestack-reactpackage needed). - FilestackProvider context: Set your
apikey,clientOptions, and callbacks (onSuccess,onUploadDone,onError) once at the app level. Every picker component (PickerOverlay,PickerInline,PickerDropPane) reads from that shared context automatically, falling back to its own props if you need to override for a specific instance. - filestack-js v4 support: Unlocking newer client methods like
download,prefetch,setSecurity, andsetCname, plus folder upload support. We recommend installing the latest 4.x release for the newest fixes. - React 19 support: The picker components and hooks are tested and verified against both React 18.3.1+ and React 19.
- Framework compatibility (Next.js, Vite, Remix): ‘use client’ directives,
useId()for stable SSR-safe IDs, and corrected ESM/CJS exports mean the SDK now works reliably in App Router and Server Components. No more manual workarounds. - Storybook: Interactive stories are now available for
PickerOverlay,PickerInline,PickerDropPane, andFilestackProvider, so you can explore component behavior before wiring it into your app.
⚙️ Improvements
- Cleaner console output: Upload results are no longer dumped to the browser console by default. Previously, every successful upload logged the full result object twice (once via
onSuccess, once viaonUploadDone), which could expose file handles and URLs in production. Now, if you don’t provide callbacks, the SDK stays silent. - No more duplicate callback firing: If you provided both
onSuccessandonUploadDone, both were being called on every upload. Now onlyonUploadDonefires, withonSuccessused as a fallback ifonUploadDoneisn’t provided, so your analytics and side effects won’t double-fire. - 35/35 tests passing across 5 test suites: Including new coverage for
PickerOverlayandPickerDropPane, previously untested components. - Smaller footprint for existing filestack-js users:
filestack-jsmoves from a direct dependency to a peer dependency, so you’re no longer bundling a duplicate copy if it’s already in your project.
🐛 Bug Fixes
- Fixed infinite re-render loop in usePicker: The hook’s
useEffectwas re-running on every render because its dependency array included values that got new references each time, causing the picker to be destroyed and recreated repeatedly. This was the root cause behind several reported issues. Thanks to everyone who reported these behaviors. Your reports helped us track this down. - Fixed Vite module resolution errors and Next.js installation issues.
Deep Dive: The FilestackProvider Context
The most useful day-to-day change in this release is the FilestackProvider context, paired with the full TypeScript rewrite behind it.
Previously, every picker component needed its own apikey, clientOptions, and callback props, even if you were rendering several pickers in the same app with identical configuration. That meant repeating the same props everywhere, with no single source of truth. In v7.0.0, FilestackProvider wraps your app (or any subtree) and holds that configuration in context. Picker components underneath it read from the provider automatically, and only fall back to their own props if you explicitly pass something different.
Wrap your app once, and every picker component underneath it inherits the same configuration:
import { FilestackProvider, PickerDropPane } from 'filestack-react';
// Set your API key and shared options once, at the root of your app
function App() {
return (
<FilestackProvider
apikey="YOUR_API_KEY"
onUploadDone={(result) => console.log(result.filesUploaded)}>
{/* Children inherit config */}
</FilestackProvider>
);
}
// No need to repeat apikey or onUploadDone here — inherited from FilestackProvider
function UploadWidget() {
return <PickerDropPane />;
}
Why this matters: if your app renders the picker in more than one place (a header upload button and a settings page avatar picker, for example), you no longer have to keep their configuration in sync by hand. Set it once at the provider, and override it per-component only when you actually need something different. Combined with the shipped TypeScript types, your editor will also flag a mismatched prop before you ever run the app.
Breaking Changes ⚠️
Read this before upgrading.
- filestack-js is now a peer dependency, not a direct dependency. You must install
filestack-jsyourself alongsidefilestack-react. If you don’t, your build will fail or the SDK will throw at runtime.npm install filestack-react@7.0.0 filestack-js@^4.0.0 - React peer dependency range changed. Now requires
react: ^18.3.1 || ^19.0.0andreact-dom: ^18.3.1 || ^19.0.0. If you’re on React <18.3.1, you’ll need to upgrade React first.
Upgrade Guide
- Update your dependencies:
npm install filestack-react@7.0.0 filestack-js@^4.0.0 # or yarn add filestack-react@^7.0.0 filestack-js@^4.0.0 - (Ensure your Node version is >= 18.3.1)
- Remove @types/filestack-react if you had it installed. Types now ship with the package itself:
npm uninstall @types/filestack-react - Add
filestack-jsexplicitly to yourpackage.jsonif it isn’t already listed: it’s now a peer dependency and won’t be installed automatically as a transitive dependency. - Check your
usePicker/ picker component callbacks. If you use bothonSuccessandonUploadDone, verify your app still behaves correctly now that onlyonUploadDonefires when both are present. - Remove any workarounds for SSR/Next.js/Vite issues. The ‘use client’ directives and corrected ESM/CJS exports mean previous workarounds for App Router or Vite resolution errors are no longer needed and can be cleaned up.
- Run your test suite. With the TypeScript rewrite, you may see new type errors surfaced in your own code where prop types were previously unchecked at compile time (these are worth fixing, not suppressing).
Try It Today
TypeScript types, React 19 support, and a shared FilestackProvider context, all in one release. If you’re building with Next.js, Vite, or Remix, this is the smoothest filestack-react has ever felt.
npm install filestack-react@7.0.0 filestack-js@^4.0.0
Senior web developer with a profound knowledge of the Javascript and PHP ecosystem. Familiar with several JS tools, frameworks, and libraries. Experienced in developing interactive websites and applications.
Read More →