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

component/hook reuse report #1151

Open
1 task
charlieforward9 opened this issue Nov 12, 2024 · 2 comments
Open
1 task

component/hook reuse report #1151

charlieforward9 opened this issue Nov 12, 2024 · 2 comments

Comments

@charlieforward9
Copy link

Describe the feature

I have been building react now for two years. For much of this time, I figured I could have one hook per module that serves all the components, putting ALL of the api's / helper methods / state variables , etc related to the module within the same hook.

I now know that is NOT how it should be done, after doing a bit of research, and that hooks should generally be granular.

I could probably communicate this better if more information is requested, but I was wondering if these hook/component instances could be tracked and portrayed somehow on the Million dashboard to give developers an understanding of how much memory is being allocated to these layers of the React tree.

If this is unrelated to this project, please help me understand where this could fit into the react dev tools that exist today.

Thanks!

Additional information

  • Would you be willing to help implement this feature?
Copy link

Thanks for opening this issue! A maintainer will review it soon.

@charlieforward9 charlieforward9 changed the title Hook Reusability Suggestions component/hook reuse report Nov 12, 2024
@aidenybai
Copy link
Owner

@charlieforward9 the difficult part of implementing this is that custom hooks are just functions in reality. Like you could name it function wooHoo() {} and it would still work. We're able to count the # of executions, but not the actual instances.

I'm interested in your dashboard idea - up for a chat? https://cal.com/aiden (sched the 1 hr option)

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

No branches or pull requests

2 participants