Skip to content

Commit dad38be

Browse files
committed
Fix failing build step
1 parent 7703564 commit dad38be

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/components/ReactP5WrapperGuard.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ import { ReactP5WrapperWithSketch } from "./ReactP5WrapperWithSketch";
88
export function ReactP5WrapperGuard<Props extends SketchProps = SketchProps>(
99
props: P5WrapperProps<Props>
1010
) {
11-
if (props.sketch === undefined) {
11+
const { sketch, fallback } = props;
12+
13+
if (sketch === undefined) {
1214
console.error("[ReactP5Wrapper] The `sketch` prop is required.");
1315

14-
return props.fallback ?? null;
16+
return fallback !== undefined ? <>{fallback}</> : null;
1517
}
1618

1719
return (

tests/rendering.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ describe("Rendering", () => {
9494
});
9595

9696
it("[General] Should use the fallback UI if the sketch is undefined on initial render", () => {
97-
const { sketch } = setupTest();
9897
const { container } = render(<ReactP5Wrapper fallback={<h1>Oh no</h1>} />);
9998

10099
assert(container.firstElementChild instanceof HTMLHeadingElement);

0 commit comments

Comments
 (0)