GithubHelp home page GithubHelp logo

Comments (5)

colinnielsen avatar colinnielsen commented on August 20, 2024 2

Here's my current fix for this:
PR coming for the docs:

  1. Install the patch-package as a dependency (NOTE: yarnv2 and pnpm have built-in support for patch-package)
  2. Open node_modules/hono/dist/types/jsx/base.d.ts
  3. Update the 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;
  1. run pnpm patch hono | yarn patch-package hono
  2. add the patch as a postinstall script in your package.json
"scripts": {
  "postinstall": "patch-package"
}

from frog.

tmm avatar tmm commented on August 20, 2024

Upstream issue honojs/hono#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.

from frog.

tmm avatar tmm commented on August 20, 2024

Linking up previous conversation about this from Discord too

https://discord.com/channels/1156791276818157609/1212219334370529370/1213172973226430474

from frog.

alongcamewayne avatar alongcamewayne commented on August 20, 2024

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.

from frog.

nakedfool avatar nakedfool commented on August 20, 2024

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.

+1

from frog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.