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

forwardRef elements use displayName if available #6222

Merged
merged 3 commits into from
Mar 27, 2019

Conversation

Krustal
Copy link
Contributor

@Krustal Krustal commented Mar 21, 2019

Issue: #5974

render the displayName for the component name if a forwardRef element
provides it.

What I did

  • Added branching logic to Node component's check for forwardRef to render original component displayName if present.
  • Add new example for forwardRef component in kitchen sink app with forwardRef element with a displayName

How to test

  • Is this testable with Jest or Chromatic screenshots? Yes
  • Does this need a new example in the kitchen sink apps? Yes
  • Does this need an update to the documentation? Maybe, to explain why things change

render the displayName for the component name if a forwardRef element
provides it.

Resolves storybookjs#5974
@Hypnosphi Hypnosphi removed their request for review March 22, 2019 00:05
@shilman shilman added bug addon: info patch:yes Bugfix & documentation PR that need to be picked to main branch labels Mar 22, 2019
@shilman shilman self-requested a review March 22, 2019 00:45
lib/api/src/version.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 25, 2019

Codecov Report

❗ No coverage uploaded for pull request base (next@187c559). Click here to learn what that means.
The diff coverage is 50%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next    #6222   +/-   ##
=======================================
  Coverage        ?   38.13%           
=======================================
  Files           ?      645           
  Lines           ?     9644           
  Branches        ?      355           
=======================================
  Hits            ?     3678           
  Misses          ?     5911           
  Partials        ?       55
Impacted Files Coverage Δ
lib/api/src/version.ts 0% <0%> (ø)
addons/info/src/components/Node.js 87.5% <100%> (ø)

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 187c559...a121c44. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 25, 2019

Codecov Report

Merging #6222 into next will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next    #6222   +/-   ##
=======================================
  Coverage   38.29%   38.29%           
=======================================
  Files         648      648           
  Lines        9838     9838           
  Branches      387      387           
=======================================
  Hits         3767     3767           
  Misses       6011     6011           
  Partials       60       60
Impacted Files Coverage Δ
addons/info/src/components/Node.js 87.5% <100%> (ø) ⬆️

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 496408c...5e48b8f. Read the comment docs.

@ndelangen ndelangen merged commit 5908559 into storybookjs:next Mar 27, 2019
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Apr 1, 2019
shilman pushed a commit that referenced this pull request Apr 1, 2019
forwardRef elements use displayName if available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: info bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants