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.

Use third party component seems to be broken

See original GitHub issue

Version

1.0.9

I can’t use the third party wrapper and get no styles on my rendered component:

import React from 'react';
import styled from 'styled-components';

class Nav extends React.Component {

    render() {

        return (
            <nav>
                <button info type="button">REGISTER</button>
                <button type="button">LOGIN</button>
            </nav>
        );

    }
}


let Nav2 = styled(Nav)`
  color: #222;
  border: 3px solid red;
  background: blue;
  font-size: 1.5em;
  font-family: Helvetica, Arial, sans-serif;
  text-align: center;
`;


export default Nav2;

Reproduction

http://www.webpackbin.com/EyvHTuK1f

Expected Behavior

Expect Nav border to be 3px solid and red and background blue

Actual Behavior

Nav use default styling

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
mxstbrcommented, Oct 28, 2016

I did not want to continue the discussion as I was afraid to look too much like a noob

Let me tell you something @santaclauze – never ever be afraid to ask a question or say your opinion. As soon as you stop being curious, you stop learning. Always ask questions, figure out what you want to know, discuss with people!

Good luck with learning to code! 😊

2reactions
bhoughcommented, Oct 26, 2016

@santaclauze You’re missing a small piece. If you look at the Third Party component part of the docs you will see a note about including a className on the “third-party” component you are styling in order for the class that is generated to be properly applied.

Here is an example: http://www.webpackbin.com/4JR5NCY1f

Read more comments on GitHub >

github_iconTop Results From Across the Web

Static analysis error when using custom 3rd party component ...
After hours of digging and trial and error I found the answer. In my question edit I refer to this page and claim...
Read more >
Disable react strict mode on third party libraries #16362 - GitHub
But I'm using third party libraries (like old react-bootstrap). ... The other issue is that strict mode seems to break functionality.
Read more >
OWASP Using Components with Known Vulnerabilities
Virtually every application has issues with keeping these components patched and updated. SECURING THIRD-PARTY SOFTWARE COMPONENTS. Component vulnerabilities ...
Read more >
Third-Party Components at Their Best - CSS-Tricks
React encourages CSS-in-JS and now the majority of the React third-party-packages we use default to that and have limited or broken class-based ...
Read more >
Bypass, remove, or rescan Audio Units plug-ins in Logic Pro ...
Learn what to do if you're using third-party Audio Units plug-ins and Logic Pro or MainStage isn't working properly, or if you can't...
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