Ripple computeBoundingRect should escape out if return null or undefined
See original GitHub issueThis is a React specific issue. We can never guarantee that we’ll actually have a DOM element since we might be in process of tearing a component down.
This leads us to an adapter implementation like this which isn’t ideal
computeBoundingRect: () =>
this.root.ref ? this.root.ref.getBoundingClientRect() : {width: 0, height: 0},
Should be an easy enough fix, just a check in the foundation that computeBoundingRect returns a truthy value, which would lead to an implementation like this, and do nothing if we don’t have a dom node
computeBoundingRect: () =>
this.root.ref && this.root.ref.getBoundingClientRect()
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Is it better to return `undefined` or `null` from a javascript ...
In that case, I would recommend returning a null. Note that a function with no specified return value implicitly returns undefined. From the...
Read more >Null Vs Undefined - Web Dev Simplified Blog
Both null and undefined mean that there is no value. If a variable is set to null or undefined it has no value...
Read more >webnfc-shoppingcart-demo/main-app.js.map at master - GitHub
n // In particular, Edge/IE can return them out of order, so we cannot\n // assume a correspondence between part index and attribute...
Read more >Essential JavaScript: Mastering null vs undefined
Both null and undefined are special non-value values to represent nothingness. By the end of this article, you will understand what we mean ......
Read more >Check if a Value Is Null or Undefined in JavaScript or Node.js
This tutorial shows you how to check whether a given value is either null or undefined .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Cool, I’ll just keep returning the fake object as a workaround.
@jamesmfriedman we have been talking about this, and although it would clean up React code (for RMWC and MDC React), it would mean we would need to have the null check in many places. We think that it should be the responsibility of the framework instead.