mirror of
https://github.com/gosticks/react-table.git
synced 2026-08-11 12:30:17 +00:00
Fix isClassComponent function (#1571)
`Object.getPrototypeOf(component)` returns React `function Component()` function itself, not `Component.prototype`.
This commit is contained in:
committed by
Tanner Linsley
parent
cbb18368b2
commit
7c73a7a631
+4
-1
@@ -288,7 +288,10 @@ export function flexRender(Comp, props) {
|
||||
function isClassComponent(component) {
|
||||
return (
|
||||
typeof component === 'function' &&
|
||||
!!Object.getPrototypeOf(component).isReactComponent
|
||||
!!(() => {
|
||||
let proto = Object.getPrototypeOf(component)
|
||||
return proto.prototype && proto.prototype.isReactComponent
|
||||
})()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user