Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 994 Bytes

File metadata and controls

45 lines (31 loc) · 994 Bytes

@srcpush/hoist-non-react-statics

TypeScript rewrite of hoist-non-react-statics with a cleaner internal structure and a Vite-based library build.

Install

npm install @srcpush/hoist-non-react-statics

Usage

import hoistNonReactStatics from '@srcpush/hoist-non-react-statics';

const Enhanced = hoistNonReactStatics(targetComponent, sourceComponent);

To skip specific statics, pass an exclude list:

hoistNonReactStatics(targetComponent, sourceComponent, {
  myStatic: true,
  myOtherStatic: true,
});

What Changed

  • Rewritten in TypeScript with typed exports.
  • Internal logic split into focused modules instead of a single file.
  • Vite library build emits both ESM and CommonJS bundles.
  • Vitest coverage keeps the original hoisting behavior around forwardRef, memo, accessors, symbols, and inherited statics.

Scripts

npm run build
npm run test
npm run typecheck

License

BSD-3-Clause. See LICENSE.md.