MCPcopy Create free account
hub / github.com/react-component/form / supportRef

Function supportRef

src/utils.js:157–176  ·  view source on GitHub ↗
(nodeOrComponent)

Source from the content-addressed store, hash-verified

155}
156
157export 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}

Callers 1

getFieldDecoratorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected