(nodeOrComponent)
| 155 | } |
| 156 | |
| 157 | export function supportRef(nodeOrComponent) { |
| 158 | const type = isMemo(nodeOrComponent) |
| 159 | ? nodeOrComponent.type.type |
| 160 | : nodeOrComponent.type; |
| 161 | |
| 162 | // Function component node |
| 163 | if (typeof type === 'function' && !(type.prototype && type.prototype.render)) { |
| 164 | return false; |
| 165 | } |
| 166 | |
| 167 | // Class component |
| 168 | if ( |
| 169 | typeof nodeOrComponent === 'function' && |
| 170 | !(nodeOrComponent.prototype && nodeOrComponent.prototype.render) |
| 171 | ) { |
| 172 | return false; |
| 173 | } |
| 174 | |
| 175 | return true; |
| 176 | } |