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

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

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants