-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
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
attachReactJsxNode convenience feature to help injecting React components in the "faked/compatibility" react JSX #2757
Comments
Hi @timurxyz Thanks for creating the issue! Certainly this approach may make up for the incompleteness of hono's jsx. But hopefully we can get it to work without these workarounds. https://ui.shadcn.com/docs/components/tooltip Regarding this, just yesterday I created a PR that fixes jsx/dom and should work. This PR also adds |
Hi @usualoma , thank you! And I tried your fix:
(The above is not related to this 2757, but chose to answer here. And will return to the actual |
@timurxyz
Sorry, my demo only focused on the result of DOM changes and omitted the application of styles. I have created a separate issue for the lack of version and client APIs, which I would like to discuss here. |
Hi @timurxyz Can we close this issue? |
Hi, your patience in awaiting my answer is much appreciated!) I suggest to consider that if we had a build-in wrapper like the above 'attachReactJsxNode' that could create a first-class pattern for incorporating user components or components of design-system libraries provided/existing as React components. The 'attachReactJsxNode'-like extension to the React emulation or even a higher level wrapper is the last mile for implementing such middleware (?) between hono code and those component sets. Which helps the DX with hono/honox. The analogy could be:
approach allowed by 'veaury'. In React itself there's no such thing obviously, but a complete emulation of the React API might need that as a complete one in terms of usage emulation. (But again, I might miss something already resolved in this regards.) |
What is the feature you are proposing?
#2508
Feature/Rationale
hono/jsx/dom
in many cases now allows for interoperation with React UI libraries / components (guests) without actually running / mounting a real React renderer or explicitly wrapping user code in react-renderer middleware. However additional code/method sugar around in-place rendering of such guest React components might help code logic / DX.Example of usage
We could take a React React component from shadcn or Tamagui or similar like:
https://ui.shadcn.com/docs/components/tooltip
and wrap it into a hono/honox (island) custom component like so (the styling issues are omitted here):
(Also works with a simple Tamagui button as of 240520)
Reference implementation code of the idea
Note: Children are handled in the ingress JSX
The above sample implementation code works. The actual implementation might better utilize the hono/useEffect internals or other dom lifecycle related internals.
*Please extend with the SSR/SSG aspects.
The text was updated successfully, but these errors were encountered: