Skip to content

FeaturedBadge: Move styled outside of the render function#35

Open
paulathevalley wants to merge 2 commits into
masterfrom
bug-styledComponentsDynamic
Open

FeaturedBadge: Move styled outside of the render function#35
paulathevalley wants to merge 2 commits into
masterfrom
bug-styledComponentsDynamic

Conversation

@paulathevalley

Copy link
Copy Markdown

👋

This PR resolves the following console warning for the <FeaturedBage> component:

The component Styled(Component) with the id of "sc-fzqAui" has been created dynamically.
You may see this warning because you've called styled inside another component.
To resolve this only create new StyledComponents outside of any render method and function component. 

This PR:

  • Move styled outside of the render function
  • Pass the Logo component as a tagName prop, so the badge can be rendered without passing isHoverable to the DOM. This approach can be revisited once styled-components is upgraded to at least v5.1.0.

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

Successfully merging this pull request may close these issues.

1 participant