Kaguya samaK
Denoโ€ข14mo agoโ€ข
2 replies
Kaguya sama

Return Type Preact Forward

I make tsx component in fresh preact but have a error said it need a return type, what is the return type for a forwardref?
66 | const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref): JSX.Element => {
| ^^^^^^^^ this symbol is missing an explicit type
|
= hint: add an explicit type annotation to the symbol

info: all symbols in the public API must have an explicit type
docs: https://jsr.io/go/slow-type-missing-explicit-type

const Button = forwardRef<HTMLButtonElement, ButtonProps>((props,ref)=> {
return (
<button>a example </button>
)}
Screenshot_2024-11-28_at_20.28.54.png
Screenshot_2024-11-28_at_20.29.26.png
JSR
JSR uses TypeScript types to generate documentation and improve Node.js compatibility. "Slow types" can get in the way of this.
About "slow types" - Docs - JSR
Was this page helpful?