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.

Question: What `will-change` is used for?

See original GitHub issue

I see in https://github.com/bvaughn/react-window/blob/master/src/createListComponent.js#L276 that you’re using will-change: transform. But from inspecting the demos it doesn’t seems that transform is used anywhere

So, what will-change is used for?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Romex91commented, Sep 10, 2020

Without will-change, the scroll freezes until every item is rendered. You won’t see this on a modern CPU.

Reproduction steps on Chrome Windows:

  1. Go Here
  2. Ctrl+Shift+I
  3. Performance->Cature Settings->CPU throttling->6x
  4. Ctrl+Shift + C
  5. Click the grid
  6. Scroll the grid
  7. Disable will-change style in Element->Styles
  8. Scroll the grid again

What’s wrong:

At step 8. scrolling gets laggy.

Why bother?

The problem becomes noticeable when you have heavier items.

What about other will-change values?

@brunolemos FYI top and left produce the same effect as transform other will-change values have no effect

1reaction
SRachamimcommented, Apr 12, 2020

I suggest to reopen this issue. It adds little value and breaks fixed positions. Consider finding an alternative optimisation or not to optimise it at all.

This seems to me more like a hack than a legitimate optimisation, because will-change actually influence the visual appearance of elements.

Read more comments on GitHub >

github_iconTop Results From Across the Web

will-change - CSS: Cascading Style Sheets - MDN Web Docs
The will-change CSS property hints to browsers how an element is expected to change. Browsers may set up optimizations before an element is ......
Read more >
will-change | CSS-Tricks
The will-change property in CSS optimizes animations by letting the browser know which properties and elements are just about to be ...
Read more >
CSS Will Change Module Level 1 - W3C
Use will-change Sparingly In Stylesheets. Using will-change directly in a stylesheet implies that the targeted elements are always a few moments ...
Read more >
How to use and how works CSS' will-change property?
So I have a few questions. Should I add this property to the element class or its hover state? .my-class{ will-change ...
Read more >
CSS | will-change property - GeeksforGeeks
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have...
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