Closed bangarang closed 1 month ago
This update enhances the @flatfile/react
package by refining event listener management, improving state handling for optional properties, and restructuring context integration. Key changes include removing the default workbook structure for flexible space creation, introducing server-side configuration components, and implementing robust error handling. These updates significantly enhance the functionality and reliability of the package, ensuring an efficient user experience in dynamic data environments.
Files | Change Summary |
---|---|
.changeset/fast-peaches-return.md |
Introduces a patch to manage listeners effectively when not inline. |
packages/react/src/components/FlatfileContext.tsx , packages/react/src/components/FlatfileProvider.tsx |
Modifies DEFAULT_CREATE_SPACE to set workbook as undefined , enhancing flexibility in space creation, and updates state management to accommodate optional workbook properties. |
apps/react/app/server-side-configure/App.tsx , apps/react/app/server-side-configure/listener.ts , apps/react/app/server-side-configure/page.tsx |
Introduces new components for server-side configuration, improving integration and management of Flatfile functionality. |
packages/react/src/components/Workbook.tsx , packages/react/src/components/Sheet.tsx |
Implements optional chaining to improve robustness against undefined properties in state management. |
packages/react/src/components/style.scss |
Restructures CSS for .flatfile-close-button for better maintainability without altering visual output. |
packages/react/src/hooks/useEvent.ts , packages/react/src/hooks/useListener.ts , packages/react/src/hooks/usePlugin.ts |
Integrates accessToken into hooks for enhanced event handling and context responsiveness, with updated dependencies. |
sequenceDiagram
participant User
participant FlatfileProvider
participant Hooks
participant API
User->>FlatfileProvider: Request accessToken
FlatfileProvider-->>User: Provide accessToken
User->>Hooks: Initialize useEvent with accessToken
Hooks->>API: Perform action with accessToken
API-->>Hooks: Return response
Hooks-->>User: Update UI based on response
Tested locally, working
Fixes a bug where you could not configure a space with a Server side listener with React Components.