react-polymorphic-types icon indicating copy to clipboard operation
react-polymorphic-types copied to clipboard

Zero-runtime polymorphic component definitions for React

Results 13 react-polymorphic-types issues
Sort by recently updated
recently updated
newest added

Hi, great library, thanks for creating it! I'm using it in [React Interactive](https://github.com/rafgraph/react-interactive) Using the `Heading` `forwardRef` example in the readme the `ref` element type implicitly is `any`: For a...

This PR allows the use of a subset of the `JSX.IntrinsicElements`. The use case is for example: ```ts import type { PolymorphicPropsWithoutRef } from "react-polymorphic-types"; // An HTML tag or...

Since the filename pointed at by `default` and `import` (`empty`) is not identical to the filename of the `d.ts` file (`index`), the top level `types` field is not enough when...

Should I get type for `type` as it's a native prop for button-element, or am I doing it wrong? https://codesandbox.io/s/still-sun-ctc81?file=/src/App.tsx

Hi, is it possible to type the props that `as` is required to accept? Without this it is easy to pass in an `as` prop that is not compatible with...

Hi, I'm trying to type a `create` function that returns a fully typed component with ref forwarding and the `as` prop predefined. This is needed when using a polymorphic component...

## Description Polymorphic component has partialized props if "as" component has unioned props. ## Reproduction ``` import * as React from 'react'; import type { PolymorphicForwardRefExoticComponent, PolymorphicPropsWithoutRef, PolymorphicPropsWithRef, } from...

## Issue In `@types/react` version 2.14 (could have started earlier), the return type of `PolymorphicForwardRefExoticComponent` started being incorrect causing a TS error. ## Example code ```tsx import type { PolymorphicForwardRefExoticComponent,...

I've got a polymorphic button component that looks like this: ```tsx import type {PolymorphicPropsWithoutRef} from 'react-polymorphic-types'; const defaultElement = 'button'; type ButtonOwnProps = { color?: string; }; type ButtonProps =...

Not strictly an issue of this library but a question about integrating with styled-components. I have the following piece of code and styled-components is unable to deduce `h1` attributes of...