1.0.0-beta.7 • Published 11 months ago

@klnjs/react-core v1.0.0-beta.7

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@klnjs/react-core

A library that simplifies implemention of React components that support the asChild paradigm. Ensures full TypeScript support for component props, and refs.

Installation

Install the @klnjs/react-core package using your preferred package manager.

npm install @klnjs/react-core

How to Use

import { poly, forwardRef, type CoreProps } from '@klnjs/react-core';

export type MyComponentProps = CoreProps<
  'div',
  {
    myCustomProp: string;
  }
>;

export const MyComponent = forwardRef<'div', MyComponentProps>(
  (props, forwardedRef) => <poly.div ref={forwardedRef} {...props} />
);