honox icon indicating copy to clipboard operation
honox copied to clipboard

Some types are not avaliable for props of island component

Open 4513ECHO opened this issue 7 months ago • 1 comments

What version of HonoX are you using?

0.1.41

What steps can reproduce the bug?

I have tried to write a code using use hook, as the official React reference shows:

import { use } from "react";

export default function SomeIslandComponent({ promise }) {
  const result = use(promise);
  return <div>{result}</div>;
}

However, this does not work because island compoents only can accept JSON-serializable props:

https://github.com/honojs/honox/blob/49897f9d47012bba9e6f590b38ca6405b642bf21/src/vite/components/honox-island.tsx#L53

What is the expected behavior?

Island compoents should be accept all serializable types which React supports.

What do you see instead?

No response

Additional information

4513ECHO avatar Jun 03 '25 11:06 4513ECHO

@4513ECHO

Hmmm. It's expected behavior. HonoX does not support React Server Components, so it can only handle JSON-serializable props.

yusukebe avatar Jun 04 '25 09:06 yusukebe