honox
honox copied to clipboard
Some types are not avaliable for props of island component
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
- Internal implemention of how react serialize props (Japanese): ReactのSerialize
@4513ECHO
Hmmm. It's expected behavior. HonoX does not support React Server Components, so it can only handle JSON-serializable props.