Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions config/typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"target": "ESNext",
"composite": true,
"useDefineForClassFields": true,
"types": ["vite/client"],
"lib": ["DOM", "DOM.Iterable", "ESNext"],
Expand All @@ -12,7 +11,7 @@
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "bundler",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": false,
Expand Down
2 changes: 1 addition & 1 deletion config/typescript/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "bundler",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
},
"include": ["../vite/vite.component.config.ts"]
Expand Down
6 changes: 4 additions & 2 deletions src/components/ReactP5WrapperGuard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const ErrorBoundary = React.lazy(() =>
}))
);

export default function ReactP5WrapperGuard<Props extends SketchProps>(
const ReactP5WrapperGuard = <Props extends SketchProps>(
props: P5WrapperProps<Props>
) {
) => {
if (props.sketch === undefined) {
console.error("[ReactP5Wrapper] The `sketch` prop is required.");

Expand Down Expand Up @@ -52,3 +52,5 @@ export default function ReactP5WrapperGuard<Props extends SketchProps>(
</ErrorBoundary>
);
}

export default ReactP5WrapperGuard;
6 changes: 4 additions & 2 deletions src/components/ReactP5WrapperWithSketch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { removeCanvasInstance } from "../utils/removeCanvasInstance";
import { updateCanvasInstance } from "../utils/updateCanvasInstance";
import { withoutKeys } from "../utils/withoutKeys";

export default function ReactP5WrapperWithSketch<Props extends SketchProps>(
const ReactP5WrapperWithSketch = <Props extends SketchProps>(
props: P5WrapperPropsWithSketch<Props>
) {
) => {
const wrapperRef: WrapperRef = React.useRef(null);
const canvasInstanceRef: CanvasInstanceRef<Props> = React.useRef(null);
const userProvidedProps: SketchProps = React.useMemo(
Expand Down Expand Up @@ -49,3 +49,5 @@ export default function ReactP5WrapperWithSketch<Props extends SketchProps>(
</div>
);
}

export default ReactP5WrapperWithSketch;