mirror of
https://github.com/gosticks/react-table.git
synced 2025-10-16 11:55:36 +00:00
fix: render components should include memo/forwardRef (#1764)
This commit is contained in:
parent
1509fc0438
commit
32ae1a52e4
14
src/utils.js
14
src/utils.js
@ -237,8 +237,20 @@ function isFunctionComponent(component) {
|
||||
return typeof component === 'function'
|
||||
}
|
||||
|
||||
function isExoticComponent(component) {
|
||||
return (
|
||||
typeof component === 'object' &&
|
||||
typeof component.$$typeof === 'symbol' &&
|
||||
['react.memo', 'react.forward_ref'].includes(component.$$typeof.description)
|
||||
)
|
||||
}
|
||||
|
||||
function isReactComponent(component) {
|
||||
return isClassComponent(component) || isFunctionComponent(component)
|
||||
return (
|
||||
isClassComponent(component) ||
|
||||
isFunctionComponent(component) ||
|
||||
isExoticComponent(component)
|
||||
)
|
||||
}
|
||||
|
||||
export function isFunction(a) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user