1.0.0-beta.2 • Published 1 year ago
@klnjs/core v1.0.0-beta.2
@klnjs/core
A library that simplifies implemention of React components that support the asChild
paradigm. Ensures full TypeScript support for component props, and refs.
Installation
You can install the @klnjs/core
package using your preferred package manager.
npm install @klnjs/core
How to Use
import { poly, forwardRef, type CoreProps } from '@klnjs/core';
export type MyComponentProps = CoreProps<
'div',
{
myCustomProp: string;
}
>;
export const MyComponent = forwardRef<'div', MyComponentProps>(
(props, forwardedRef) => <poly.div ref={forwardedRef} {...props} />
);
1.0.0-beta.2
1 year ago
1.0.0-beta.1
1 year ago