Replies: 3 comments 3 replies
-
|
Hi, shouldn't the linter point at the "offending" line of code? I wonder if this could be a bug in the React Compiler linter. Got a repository to look at? |
Beta Was this translation helpful? Give feedback.
-
|
Although I didn't understand the message, but probably you are asking the line number of code where it arising the error or you want to get a repository to solve the problem. If your questions is this, then yea its providing the offending line number- from my above component, you will see a const onSubmit: SubmitHandler<ReceiptFormInput> = async (value) => {
let sigUrl: string;
if (sig) {
const { blob } = await upload(ref.current?.toFile());
sigUrl = blob?.url || ""
} else {
sigUrl = item.signature
}
if (template) {
mutate({
...value,
templateId: template.templateId,
previewUrl: template.previewUrl,
signature: sigUrl,
id: item.id
});
}
}from this handler I am reading a ref value- const { blob } = await upload(ref.current?.toFile());So react compiler throwing error here by saying- |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
A linting error I am getting-
Here is the component-
I am not calling ref during render time. Its on a
onSubmithandler. Is onSubmit will call render time. What will be suggestions to get rid off this lint error. As it is onSubmut handler so it should be event handler. Event handler should not run during render.Beta Was this translation helpful? Give feedback.
All reactions