Skip to content

Commit d741337

Browse files
authored
change typescript module resolution to resolve typescript resolution … (#494)
1 parent c79d830 commit d741337

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

config/typescript/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"compilerOptions": {
33
"target": "ESNext",
4-
"composite": true,
54
"useDefineForClassFields": true,
65
"types": ["vite/client"],
76
"lib": ["DOM", "DOM.Iterable", "ESNext"],
@@ -12,7 +11,7 @@
1211
"strict": true,
1312
"forceConsistentCasingInFileNames": true,
1413
"module": "ESNext",
15-
"moduleResolution": "bundler",
14+
"moduleResolution": "node",
1615
"resolveJsonModule": true,
1716
"isolatedModules": true,
1817
"noEmit": false,

config/typescript/tsconfig.node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"composite": true,
44
"module": "ESNext",
5-
"moduleResolution": "bundler",
5+
"moduleResolution": "node",
66
"allowSyntheticDefaultImports": true
77
},
88
"include": ["../vite/vite.component.config.ts"]

src/components/ReactP5WrapperGuard.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const ErrorBoundary = React.lazy(() =>
1717
}))
1818
);
1919

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

@@ -52,3 +52,5 @@ export default function ReactP5WrapperGuard<Props extends SketchProps>(
5252
</ErrorBoundary>
5353
);
5454
}
55+
56+
export default ReactP5WrapperGuard;

src/components/ReactP5WrapperWithSketch.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import { removeCanvasInstance } from "../utils/removeCanvasInstance";
99
import { updateCanvasInstance } from "../utils/updateCanvasInstance";
1010
import { withoutKeys } from "../utils/withoutKeys";
1111

12-
export default function ReactP5WrapperWithSketch<Props extends SketchProps>(
12+
const ReactP5WrapperWithSketch = <Props extends SketchProps>(
1313
props: P5WrapperPropsWithSketch<Props>
14-
) {
14+
) => {
1515
const wrapperRef: WrapperRef = React.useRef(null);
1616
const canvasInstanceRef: CanvasInstanceRef<Props> = React.useRef(null);
1717
const userProvidedProps: SketchProps = React.useMemo(
@@ -49,3 +49,5 @@ export default function ReactP5WrapperWithSketch<Props extends SketchProps>(
4949
</div>
5050
);
5151
}
52+
53+
export default ReactP5WrapperWithSketch;

0 commit comments

Comments
 (0)