Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.
This repository was archived by the owner on Aug 5, 2026. It is now read-only.

[bpk-component-infinite-scroll] Migrate to TypeScript #4744

Closed

Description

Context

bpk-component-infinite-scroll is a pure-JS package with 4 source files. This package has a class-based HOC (withInfiniteScroll) that is also affected by the React 19 defaultProps migration.

Files to migrate (4)

File Type
src/withInfiniteScroll.js Class-based HOC — uses prop-types and defaultProps
src/DataSource.js Data source utility
src/intersection-observer.js Intersection observer wrapper
src/withInfiniteScroll-test.flow.js Flow type test file — remove or convert

Migration guidance

  1. Rename all .js → .tsx (components) or .ts (utilities).
  2. Replace prop-types imports with TypeScript interfaces/types.
  3. Migrate withInfiniteScroll class component — convert static defaultProps to destructure defaults or convert to a functional component with hooks. This is also tracked in the React 19 migration (REACT_19_MIGRATION.md).
  4. Remove withInfiniteScroll-test.flow.js — Flow is no longer used in Backpack; convert any useful type assertions to TS.
  5. Update test files and Storybook stories to .tsx.
  6. Update index.js → index.ts and package entry points.
  7. Run npm run lint, npm run typecheck, and npm test.

⚠️ React 19 interaction

The withInfiniteScroll HOC has defaultProps on a class component. Under React 19, class defaultProps still work but are deprecated for function components. A recent fix (#4689) corrected a bug where initiallyLoadedElements was used instead of elementsPerScroll — ensure the TS migration preserves this fix.

References

Activity

  1. gert-janvercauteren commented on Jul 3, 2026

    @gert-janvercauteren
    ContributorAuthor

    This was generated by AI during triage.

    Triaged as enhancement / ready-for-human. The mechanical TS rename is agent-ready, but withInfiniteScroll is a class-based HOC with defaultProps that intersects the React 19 migration (REACT_19_MIGRATION.md). The decision of whether to do a minimal class-component TS migration or take the opportunity to convert to a functional component with hooks requires human judgment before an agent picks this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready-for-humants-conversion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions