()
| 220 | this.strategy === 'callback' ? this.callbackState : this.state |
| 221 | |
| 222 | handleDOMNode() { |
| 223 | const found = this.element && ReactDOM.findDOMNode(this.element) |
| 224 | |
| 225 | if (!found) { |
| 226 | // If we previously had a dom node then we need to ensure that |
| 227 | // we remove any existing listeners to avoid memory leaks. |
| 228 | this.uninstall() |
| 229 | return |
| 230 | } |
| 231 | |
| 232 | if (!this.domEl) { |
| 233 | this.domEl = found |
| 234 | this.detector.listenTo(this.domEl, this.checkIfSizeChanged) |
| 235 | } else if ( |
| 236 | (this.domEl.isSameNode && !this.domEl.isSameNode(found)) || |
| 237 | this.domEl !== found |
| 238 | ) { |
| 239 | this.uninstall() |
| 240 | this.domEl = found |
| 241 | this.detector.listenTo(this.domEl, this.checkIfSizeChanged) |
| 242 | } else { |
| 243 | // Do nothing 👍 |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | refCallback = (element) => { |
| 248 | this.element = element |
no outgoing calls
no test coverage detected