Skip to content

null instead of Object {} for imported css  #108

@ashgaliyev

Description

@ashgaliyev

Hello! I've recently upgraded from 1.5.1 to 3.3.4 and saw that all properties that get css files have been rewritten from Object {} to null

I didn't find this change in the changelog and maybe it is a bug?

here is an example:

import React from 'react';
import LinkInner from './LinkInner';
import styles from './style.css';

class Link extends React.Component {
  render() {
    return (
      <a href={this.props.page || '#'}>
        <LinkInner theme={styles} />
      </a>
    );
  }
}

export default Link;

test:

import React from 'react';
import Link from './Link';
import { shallow } from 'enzyme';

it('renders correctly', () => {
  const component = shallow(<Link page="http://www.facebook.com">Facebook</Link>);
  expect(component).toMatchSnapshot();
});

snapshot:

exports[`renders correctly 1`] = `
<a
  href="http://www.facebook.com"
>
  <LinkInner
    theme={null}
  />
</a>
`;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions