Skip to content

Commit

Permalink
JSX children prop support
Browse files Browse the repository at this point in the history
adeira-source-id: 0866bdaf44d6bda747390a9a246fa33d12b8e94f
  • Loading branch information
itsdouges authored and triplex-bot committed Dec 28, 2024
1 parent 4c360f6 commit 4c868b5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-laws-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@triplex/server": patch
---

The `children` prop can now be edited inside the element panel for all supported types.
5 changes: 5 additions & 0 deletions .changeset/ninety-candles-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@triplex/server": patch
---

The `attach` prop for React Three Fiber elements is now visible in the elements panel.
8 changes: 6 additions & 2 deletions examples/test-fixture/src/component-roots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ export function ThreeFiberRootFromAnotherModule() {
}

export function ReactRoot() {
return <div data-testid="react-root" style={{ height: '100vh', width: '100vh' }}>Hello World</div>;
return (
<div data-testid="react-root" style={{ height: "100vh", width: "100vh" }}>
Hello World
</div>
);
}

export function ReactRootFromAnotherModule() {
return <Button text="Button"/>;
return <Button>Button</Button>;
}

export function Unknown() {
Expand Down
6 changes: 3 additions & 3 deletions examples/test-fixture/src/react-roots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
import { Canvas } from "@react-three/fiber";

export function Button({
children,
color = "red",
text,
}: {
children: string;
color?: "red" | "blue";
text: string;
}) {
return (
<button style={{ color, height: "100vh", width: "100vh" }} type="submit">
{text}
{children}
</button>
);
}
Expand Down

0 comments on commit 4c868b5

Please sign in to comment.