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.

`insertCss` constraint

See original GitHub issue

Aloha everyone,

during test coverage of my component i found the problem with shallow rendering. For example code using enzyme:

const StyledComponent = withStyles('')(
  class Foo extends Component {
    render() {
      return <div />;
    }
  }
);

expect(shallow(<StyledComponent />).html()).to.equal('<div></div>');

After execute this code, test return error: Cannot read property 'apply' of undefined. I found the cause of this error, and change withStyles module for fix error while maintaining backward compatibility.

About reason of error. I think this insertCss as required property in propTypes is unjustified constraint, because when you need create isolated test of component you can’t do this.

What you think about this issue?

Thanks!

P.S. if maintainer or community decide that actually problem, i can do PR for resolve this issue.

<bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38033508-insertcss-constraint?utm_campaign=plugin&utm_content=tracker%2F26439769&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F26439769&utm_medium=issues&utm_source=github). </bountysource-plugin>

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
QuentinDejeancommented, Jan 23, 2017

Same here, thanks guys!

5reactions
frenzzycommented, Oct 16, 2016

Maybe withStyles higher-order component should not require context.insertCss and just warn if it was not provided, ref #63

@koistya what do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

tabs.insertCSS() - Mozilla - MDN Web Docs
This is an asynchronous function that returns a Promise (on Firefox only). Syntax. let inserting = browser.tabs.insertCSS( ...
Read more >
How to run chrome.tabs.insertCSS from the background page ...
chrome.tabs.onCreate has to be replaced with chrome.tabs.onCreated (with a d!). After fixing this, you'd better pass a tabId to the ...
Read more >
Developers - `insertCss` constraint - - Bountysource
during test coverage of my component i found the problem with shallow rendering. For example code using enzyme : const StyledComponent = withStyles('')(...
Read more >
Introducing chrome.scripting - Chrome Developers
Second, our API had a different set of design constraints (e.g. ... In Manifest V2, executeScript and insertCSS would return an array of ......
Read more >
Problem upgrading from 8.9.16 to 9.2.0 | Drupal.org
0] but it does not match the constraint. - composer/installers[v1.7.0, .
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