mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.79k stars 1.9k forks source link

why is react component re-rendering when I put in text ? #6994

Closed byungmin12 closed 4 weeks ago

byungmin12 commented 4 weeks ago

Dependencies check up

What version of @mantine/* packages do you have in package.json?

7.13.2

What package has an issue?

@mantine/form

What framework do you use?

Vite

In which browsers you can reproduce the issue?

None

Describe the bug

I use useForm of mantine. and have too many inputs. I choose "uncontrolled mode" in useForm Because i have to reduce times of re-rendering. however re-rendering occurred when the first letter was entered

https://github.com/user-attachments/assets/4f304563-8e73-4b2c-b8f0-d9c2a8598e1d

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

rtivital commented 4 weeks ago

In this case, useForm rerenders because dirty field status changes. It is intended – it is required for other form features to work correctly.

byungmin12 commented 4 weeks ago

@rtivital if it is intended, how can I optimize re-rendering issue ? Is the first rendering inevitable by dirty?

rtivital commented 4 weeks ago

It cannot be changed