Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestion: use React memo on Input, Suggestion and Tags to avoid re render #264

Open
rrfaria opened this issue Jun 12, 2022 · 2 comments
Open

Comments

@rrfaria
Copy link

rrfaria commented Jun 12, 2022

I noticed every single time there is a blur event even if nothing is changed
All componentes are rendered again

to avoid it you can use React.memo.
It will memoize properties and only will render again if any property changes

you can add it to:
Input, Suggestions and Tag component

import React from 'react'

class Input extends React.Component {
 // implementation ....
 
}
export default React.memo(Input)

you can check re render by using react dev tools
image
and enable highligh updates
image

@crazyyi
Copy link

crazyyi commented Jul 16, 2022

Yes it is re-rendering too often.

@hritikb27
Copy link

hritikb27 commented Aug 31, 2022

@i-like-robots Have added it, please review my PR: #270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants