Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Could you pls explain how this part works - ...(tooltip && { tooltip }),? It does work on component but when I try to use something like this in the code I get an error meaning that I try to spread non-iterable value
    – skwisgaar
    Commented Mar 16, 2020 at 20:17
  • 1
    probably because falseyValue && {} will return false, so its likely you are spreading on false eg ...(false). much better to use full expression so the spread continues to behave ...(condition ? {foo: 'bar'} : {}) Commented Apr 20, 2020 at 13:17