Skip to content

feature/use rerender props in wrapper #381

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

Merged

Conversation

adamseckel
Copy link
Contributor

@adamseckel adamseckel commented Jun 4, 2020

What:

Updates renderHook to pass props into a provided wrapper component. See discussion here: #322 w @mpeyper

Why:

This allows easily testing how a hook response to changes in a parent context, without having to mutate values in test code.

How:

Pass the value of hookProps.current into render.

Checklist:

  • Documentation updated
  • Tests
  • Ready to be merged
  • Added myself to contributors table

@codecov
Copy link

codecov bot commented Jun 4, 2020

Codecov Report

Merging #381 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #381   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines           94        94           
  Branches        15        15           
=========================================
  Hits            94        94           
Impacted Files Coverage Δ
src/pure.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e77aab8...5eaac2d. Read the comment docs.

Copy link
Member

@mpeyper mpeyper left a comment

Choose a reason for hiding this comment

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

Perfect, thanks.

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

Successfully merging this pull request may close these issues.

2 participants