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

feat: implement useRenderCount hook #990

Merged
merged 4 commits into from
Nov 20, 2022

Conversation

ChloeMouret
Copy link
Contributor

@ChloeMouret ChloeMouret commented Oct 25, 2022

What new hook does?

useRendersCount tracks component's renders count including the first render.

#33

Checklist

  • Have you read contribution guideline?
  • Have the files been linted and formatted?
  • Have the docs been updated?
  • Have the tests been added to cover new hook?
  • Have you run the tests locally to confirm they pass?

@ArttuOll
Copy link
Contributor

Thanks for the PR!

I had a quick look at the code. Seems OK so far. I'll do a more thorough review later.

I think it would be more correct english to call the hook useRenderCount.

Running the workflows on this now.

@xobotyi What do you think about this hook?

@codecov
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Merging #990 (0d87619) into master (095d371) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #990   +/-   ##
=======================================
  Coverage   99.61%   99.61%           
=======================================
  Files          60       61    +1     
  Lines        1036     1041    +5     
  Branches      163      163           
=======================================
+ Hits         1032     1037    +5     
  Misses          2        2           
  Partials        2        2           
Impacted Files Coverage Δ
src/index.ts 100.00% <100.00%> (ø)
src/useRenderCount/useRenderCount.ts 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@xobotyi xobotyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. You havent updated README.md
  2. index.ts is missing reexport of this hook
  3. You should add note within migrating-from-react-use.story.mdx

@ArttuOll ArttuOll added the 🎂 new hook New hook added label Nov 12, 2022
@xobotyi xobotyi changed the title Add useRendersCount hook feat: implement new hoow useRenderCount Nov 18, 2022
@xobotyi xobotyi changed the title feat: implement new hoow useRenderCount feat: implement useRenderCount hook Nov 18, 2022
Copy link
Contributor

@ArttuOll ArttuOll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a couple of typo fixes, otherwise looks good to me!

@xobotyi xobotyi merged commit efbeeb1 into react-hookz:master Nov 20, 2022
github-actions bot pushed a commit that referenced this pull request Nov 20, 2022
# [19.2.0](v19.1.0...v19.2.0) (2022-11-20)

### Features

* implement `useRenderCount` hook ([#990](#990)) ([efbeeb1](efbeeb1))
@xobotyi
Copy link
Contributor

xobotyi commented Nov 20, 2022

🎉 This PR is included in version 19.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants