Closed colinnielsen closed 7 months ago
Upstream issue https://github.com/honojs/hono/issues/2232
We might be able to chuck in the additional types, like Element | ReactElement | ...
or add a way to invert control (declaration merging Register
pattern) as a workaround.
Linking up previous conversation about this from Discord too
https://discord.com/channels/1156791276818157609/1212219334370529370/1213172973226430474
Here's my current fix for this: PR coming for the docs:
node_modules/hono/dist/types/jsx/base.d.ts
Child
definition to include React.ReactNode
- export type Child = string | Promise<string> | number | JSXNode | null | undefined | boolean | Child[];
+ export type Child = string | Promise<string> | number | JSXNode | null | undefined | boolean | Child[] | React.ReactNode;
pnpm patch hono
| yarn patch-package hono
package.json
"scripts": {
"postinstall": "patch-package"
}
I'm still running into this issue on frog 0.8.1
and hono 4.2.3
with Next.js. @colinnielsen's solution is working for me though.
I'm still running into this issue on frog
0.8.1
and hono4.2.3
with Next.js. @colinnielsen's solution is working for me though.
+1
Describe the bug
What: I get a JSX type errors when nesting Frog UI elements. When: using Frog + Next js
package.json
Link to Minimal Reproducible Example
https://github.com/colinnielsen/frog-type-error
Steps To Reproduce
git clone https://github.com/colinnielsen/frog-type-error.git
cd frog-type-error
npm i
code .
app/api/[[...routes]]/route.tsx
Frog Version
0.8.0
TypeScript Version
5.4.2
Check existing issues
Anything else?
No response