fix: conditionally rendered element under fragment in island does not render (#1172)

This might be fixing #502, but I am not sure. All tests pass. I've added
additional test cases for comments from #502

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
azerum
2023-05-23 12:24:05 +10:00
committed by GitHub
co-authored by Asher Gomez
parent 9c73cea878
commit 7d23ed5984
8 changed files with 271 additions and 143 deletions
@@ -0,0 +1,18 @@
import { useState } from "preact/hooks";
export default function RootFragmentWithConditionalFirst() {
const [shown, setShown] = useState(false);
return (
<>
{shown && <div>I'm rendered on top</div>}
Hello
<div
onClick={() => setShown(true)}
id="root-fragment-conditional-first-click-me"
>
World
</div>
</>
);
}