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

Extending of files with the same name produced wrong class names (displayName enabled) #141

Closed
Ky6uk opened this issue May 14, 2018 · 2 comments

Comments

@Ky6uk
Copy link

Ky6uk commented May 14, 2018

./Section.js

import styled from 'styled-components';

export const Section = styled.div`
  color: red;
`;

./A/Section.js

import styled from 'styled-components';
import { Section as BaseSection } from './Section.js'; 

export const Section = styled(BaseSection)`
  color: green;
`;

./B/Section.js

import styled from 'styled-components';
import { Section as BaseSection } from './A/Section.js'; 

export const Section = styled(BaseSection)`
  color: blue;
`;

App.jsx

import React, { Component } from 'react';
import { Section } from './B/Section.js';

class App extends Component {
  render() {
    return (
      <Section>
        Bork
      </Section>
    );
  }
}

export default App;

So Bork should be in blue color here (and it is without this plugin). But with this plugin the color of Bork is red because class names are the same when "displayName": true.

@Ky6uk
Copy link
Author

Ky6uk commented May 14, 2018

That issue can be related to styled-components/styled-components#1715

@Ky6uk Ky6uk changed the title Extending of files with the same name produced wrong class names Extending of files with the same name produced wrong class names (displayName enabled) May 14, 2018
@Ky6uk
Copy link
Author

Ky6uk commented Jun 20, 2018

Fixed in SC v3.3.3

@Ky6uk Ky6uk closed this as completed Jun 20, 2018
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

No branches or pull requests

1 participant