Skip to content

Support React 19 #263

@meritmalling

Description

@meritmalling

Updating @flatfile/react for React 19 Support

Overview

This document outlines the steps required to update the @flatfile/react package to support React 19 while maintaining backwards compatibility where possible.

Current State

  • Current React support: ^16.0.0 || ^17.0.0 || ^18.0.0
  • Build system: Rollup + TypeScript
  • Testing: Jest with React Testing Library

Required Changes

1. Package.json Updates

{
  "peerDependencies": {
    "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
    "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
  },
  "devDependencies": {
    "@types/react": ">=16.9.0 <20.0.0",
    "@types/react-dom": ">=16.9.0 <20.0.0"
  }
}

2. TypeScript Configuration

  • Review and update tsconfig.json if needed for React 19 JSX transformations
  • Ensure JSX runtime compatibility

3. Testing Updates

  • Update testing-library/react to latest version
  • Review and update test configurations for React 19 compatibility

4. Code Review Areas

Key areas to review for React 19 compatibility:

  1. useEffect and useLayoutEffect usage in:

    • FlatfileProvider.tsx
    • useFlatfile.ts
    • Other hooks
  2. Event handling in:

    • EmbeddedIFrameWrapper
    • Space components
    • Event listeners
  3. React.FC usage and component types

  4. Test to determine others

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions