@klnjs/react-core
v1.0.0-beta.7
Published
A library that simplifies implemention of React components that support the `asChild` paradigm. Ensures full [TypeScript](https://www.typescriptlang.org/) support for component props, and refs.
Downloads
2
Readme
@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} />
);