We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug I have a react/typescript project that I am migrating to preact+preact/compat.
Many of our existing library components extend React.HTMLProps, for example:
React.HTMLProps
import * as React from 'react'; export interface BadgeProps extends React.HTMLProps<HTMLSpanElement> { isRead: boolean; }
After aliasing react to use preact/compat, it complains that Namespace 'React' has no exported member 'HTMLProps'.
Namespace 'React' has no exported member 'HTMLProps'
Workaround for me is to update the component file
import { JSX } from 'preact'; export interface BadgeProps extends JSX.HTMLAttributes<HTMLSpanElement> { ... }
Expected behavior What should have happened when following the steps above?
I would have expected HTMLProps to exist in preact/compat so that I don't have to change hundreds of component files.
The text was updated successfully, but these errors were encountered:
You can patch the types yourself in the meantime, no need for batch renaming:
// global.d.ts import * as preact from 'preact'; declare module 'react' { export interface HTMLProps<T> extends preact.JSX.HTMLAttributes<T> {} }
Sorry, something went wrong.
HTMLProps
Similar problem for https://floating-ui.com/docs/react-examples https://codesandbox.io/s/admiring-lamport-5wt3yg?file=/src/DropdownMenu.tsx:401-432
React.SetStateAction
Please open a new issue (or PR, if you're willing) for that.
It's impossible to track issues listed as replies to already closed issues.
Successfully merging a pull request may close this issue.
Describe the bug
I have a react/typescript project that I am migrating to preact+preact/compat.
Many of our existing library components extend
React.HTMLProps
, for example:After aliasing react to use preact/compat, it complains that
Namespace 'React' has no exported member 'HTMLProps'
.Workaround for me is to update the component file
Expected behavior
What should have happened when following the steps above?
I would have expected HTMLProps to exist in preact/compat so that I don't have to change hundreds of component files.
The text was updated successfully, but these errors were encountered: