Skip to content

Commit 277ed08

Browse files
committed
Remove usage of forwardRef
1 parent 13ff88b commit 277ed08

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/website/src/components/Editor.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useRef, useEffect, useState, forwardRef, useImperativeHandle } from "react";
1+
import { useRef, useEffect, useState, useImperativeHandle } from "react";
22
import { EditorView, basicSetup } from "codemirror";
33
import { EditorState } from "@codemirror/state";
44
import { linter } from "@codemirror/lint";
@@ -62,7 +62,7 @@ const syntaxLinter = linter((view) => {
6262
return diagnostics;
6363
});
6464

65-
const Editor = forwardRef(function Editor({ defaultValue = "", onChange }, ref) {
65+
const Editor = function Editor({ defaultValue = "", onChange, ref }) {
6666
let editorContainerRef = useRef(null);
6767
let editorViewRef = useRef(null);
6868

@@ -114,6 +114,6 @@ const Editor = forwardRef(function Editor({ defaultValue = "", onChange }, ref)
114114
return (
115115
<div className="editor" ref={editorContainerRef}></div>
116116
);
117-
});
117+
}
118118

119119
export default Editor;

packages/website/src/components/ImageZoom.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect, useRef, forwardRef, useImperativeHandle } from "react";
1+
import { useState, useEffect, useRef, useImperativeHandle } from "react";
22
import * as imageZoomClasses from "./ImageZoom.module.css";
33

44
export const zoomLevels = [
@@ -40,7 +40,7 @@ function measureFitZoomLevel(container, dimensions) {
4040
return Math.min(widthRatio, heightRatio);
4141
}
4242

43-
const ImageZoom = forwardRef(function ImageZoom({ svg, zoom, onZoomChange }, ref) {
43+
const ImageZoom = function ImageZoom({ svg, zoom, onZoomChange, ref }) {
4444
const blobURLRef = useRef(null);
4545
const imageRef = useRef(null);
4646
const containerRef = useRef(null);
@@ -138,6 +138,6 @@ const ImageZoom = forwardRef(function ImageZoom({ svg, zoom, onZoomChange }, ref
138138
<div className={imageZoomClasses.container} ref={containerRef}>
139139
</div>
140140
);
141-
});
141+
}
142142

143143
export default ImageZoom;

0 commit comments

Comments
 (0)