Skip to content

My index.js renderized and i not want this #8727

New issue

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

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

Already on GitHub? # to your account

Closed
DanielSanchez94 opened this issue Mar 26, 2020 · 2 comments
Closed

My index.js renderized and i not want this #8727

DanielSanchez94 opened this issue Mar 26, 2020 · 2 comments

Comments

@DanielSanchez94
Copy link

My index.js renders every time and I don't want this.

I don't know what happens, but every time I press a button on my sidebar my index.js renders

some help?

@w3bdesign
Copy link

w3bdesign commented Mar 27, 2020

@DanielSanchez94

It is difficult to answer this question without seeing some source code, but if I were you I would look into optimizing with useMemo or useCallback.

It is also possible that you can use useEffect with an array dependency, but like I said, without seeing some source code, it is difficult to give better advice.

Take a look at https://reactjs.org/docs/hooks-reference.html and read useEffect, useMemo and useCallback.

@DanielSanchez94
Copy link
Author

I am sorry, i just make a mistake with the library i was importing

@lock lock bot locked and limited conversation to collaborators Apr 2, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants