Skip to content
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

More React compatibiliy #2508

Open
yusukebe opened this issue Apr 14, 2024 · 5 comments
Open

More React compatibiliy #2508

yusukebe opened this issue Apr 14, 2024 · 5 comments
Labels
enhancement New feature or request.

Comments

@yusukebe
Copy link
Member

What is the feature you are proposing?

I started thinking wishing hono/jsx/dom would be more compatible with React.

Using a bundler such as Vite to create an alias with hono/jsx/dom in react will work with some React libraries.

resolve: {
  alias: {
    react: 'hono/jsx/dom'
  }
}

For example, React DnD works: https://github.com/usualoma/hono-jsx-dnd

However, when I tried other UI libraries, they all failed to work.

The errors will occur if the following are not exported:

  • createRef
  • Fragment
  • forwardRef
  • Children
  • etc

Also, even if there is an API, the behavior is different, resulting in an error.

However, it would be great if these libraries were available so that more people could use hono/jsx.

@yusukebe yusukebe added the enhancement New feature or request. label Apr 14, 2024
@yusukebe
Copy link
Member Author

@usualoma

How do you think about this thing? Now, I'm trying to create a Twitter clone with HonoX. I'm referring to the following repository:

https://github.com/Micheal-Earl/mitwi

It is built with Fresh, a preact-based framework on Deno. The interesting point is that it uses React libraries such as react-toastify and spinners-react. The project makes the alias react to preact. I think this is a good idea, and I noticed that we can do the same thing with hono/jsx/dom.

I think that project is a good reference. If we can make the same functions with that project, Hono/HonoX will be used by more developers.

@yusukebe
Copy link
Member Author

However, I think there is an option not to do this, maybe just keep the hono/jsx/dom implementation to a minimum and use React when creating full-stack pages with HonoX or other UIs. We should discuss which way to go.

@usualoma
Copy link
Member

Yes, let's try a little work. Please wait a moment!

@usualoma
Copy link
Member

Work in progress... #2553

@seivan
Copy link

seivan commented Apr 25, 2024

I second this.
One of the benefits of using React TSX/JSX is the ecosystem.

Is it possible not to focus on compatibility, and instead just straight up figure out how to use it directly? Or at least as a first party plugin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

3 participants