(component: Object)
| 159 | } |
| 160 | |
| 161 | function findHostInstance(component: Object): PublicInstance | null { |
| 162 | const fiber = getInstance(component); |
| 163 | if (fiber === undefined) { |
| 164 | if (typeof component.render === 'function') { |
| 165 | throw new Error('Unable to find node on an unmounted component.'); |
| 166 | } else { |
| 167 | const keys = Object.keys(component).join(','); |
| 168 | throw new Error( |
| 169 | `Argument appears to not be a ReactComponent. Keys: ${keys}`, |
| 170 | ); |
| 171 | } |
| 172 | } |
| 173 | const hostFiber = findCurrentHostFiber(fiber); |
| 174 | if (hostFiber === null) { |
| 175 | return null; |
| 176 | } |
| 177 | return getPublicInstance(hostFiber.stateNode); |
| 178 | } |
| 179 | |
| 180 | function findHostInstanceWithWarning( |
| 181 | component: Object, |
no test coverage detected