question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

We’re getting a lot of people on gitter asking about how to make components stylable - as in styled(Link) - usually having run into needing the className prop used meaningfully on their component. This should probably be clarified in documentation, and is justified for entry as a frequently asked question.

Something to the effect of this:

How do I use styled-components to style my custom components?

Any component which uses the classNameprop sensibly will work with styled-components.

const MyComp = props => <div className={props.className}>
  This is my content
</div>

const MyStyledComp = styled(MyComp)`
  background-color: red;
`;

Not that the className passed in props gets applied to the <div> tag in the example component. This is how styled-components applies style to elements.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mxstbrcommented, Apr 1, 2017

I think the best way to go forward with docs is to move them to the website. Embedded live snippets and nice navigation should clear up a lot of common confusions, I just don’t have time to dig in right now 😕

1reaction
kittencommented, Mar 23, 2017

@mxstbr I think the right way to go forward with the docs is to have a “recipes” section for stuff like this. It’s too easy to miss things, if the most important things are just in the readme with brief descriptions and instructions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Build Expandable and Collapsible FAQ Elements
There's an easier way to sort through and organize these FAQ pages. Expandable and Collapsible FAQ elements only show the questions most commonly...
Read more >
how to create faq expansion pages - BigCommerce Support
how to create faq expansion pages ... I meant to ask if there is a way to create a web page that is...
Read more >
FAQ expansion - PiWall
FAQ expansion. The FAQ is taking shape with lots of configuration, screen, general and licensing information added. News.
Read more >
link to trigger expansion of FAQ - WordPress.org
Is there a way to link to the page with one particular FAQ open? Something like a page anchor (#) or URL parameter...
Read more >
U.S. Expansion and Fundraising: A Comprehensive FAQ
U.S. Expansion and Fundraising: A Comprehensive FAQ. [LAST UPDATED: November 1, 2022]. For many high-growth UK/European and Israeli tech and life sciences ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found