How 'displayName' Helps In Testing React Using Styled Componentsby@anuradha15
3,134 reads

How 'displayName' Helps In Testing React Using Styled Components

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

How 'displayName' Helps In Testing React Using Styled Components reads: "How to get rid of the weird styled component names in test snapshots" Anuradha Kumari is a Frontend Consultant, Accessibility advocate and front-end consultant. The displayName provided by React is a recommended feature which helps a lot with unit testing as well as debugging the code. We can solve all the issues as mentioned above by just specifying displayName for all the styled components in the test file.

Company Mentioned

Mention Thumbnail
featured image - How 'displayName' Helps In Testing React Using Styled Components
Anuradha Kumari HackerNoon profile picture

@anuradha15

Anuradha Kumari


Receive Stories from @anuradha15

react to story with heart
Anuradha Kumari HackerNoon profile picture
by Anuradha Kumari @anuradha15.Frontend Consultant, GDE, MVP, MDE, Accessibility advocate, https://anuradhakumari.com/
Read My Stories

RELATED STORIES

L O A D I N G
. . . comments & more!