We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f066443 commit 36040b0Copy full SHA for 36040b0
README.md
@@ -224,6 +224,15 @@ Check the render method of `C`.
224
225
or you receive some sort of null error (e.g. `Cannot read properties of undefined (reading 'a')`) because `ref.current` is always undefined.
226
227
+Type errors can also occur at `useRef` in a component that uses the component under transformation:
228
+
229
+```
230
+test.tsx:1:1 - error TS2749: 'C' refers to a value, but is being used as a type here. Did you mean 'typeof C'?
231
232
+41 const component = React.useRef<C | null>(null);
233
+ ~
234
235
236
#### Cause
237
238
Class components receives refs, and the ref points to the instance of the class. Functional components do not receive refs by default.
0 commit comments