solid-start
solid-start copied to clipboard
Spread objects with callbacks break the properties
- SolidJS v1.6.3: https://playground.solidjs.com/anonymous/d6884656-5176-4a33-a0cd-ab0351648fac
import { render } from "solid-js/web";
function Child(props: { a: number; b: number }) {
return (
<div>
<div>a: {props.a}</div>
<div>b: {props.b}</div>
</div>
);
}
export function Root() {
const b = () => 2;
return <Child {...{ a: 1, b: b() }} />;
}
render(() => <Root />, document.getElementById("app")!);
- SolidJS v1.6.3 + SolidStart v0.2.7: https://stackblitz.com/edit/github-pkoqsx-hxpsu9?file=src%2Froot.tsx
function Child(props: { a: number; b: number }) {
return (
<div>
<div>a: {props.a}</div>
<div>b: {props.b}</div>
</div>
);
}
export default function Root() {
const b = () => 2;
return <Child {...{ a: 1, b: b() }} />;
}
fixed with https://github.com/solidjs/solid/pull/1403