mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-31 05:03:21 +08:00
Merge pull request #11154 from storybookjs/fix/forwardedComponent
Addon-docs: Fix forwardRef & invalid hook call
This commit is contained in:
commit
f2352a34e4
@ -1,5 +1,5 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { isForwardRef, isMemo } from 'react-is';
|
||||
import { isMemo } from 'react-is';
|
||||
import {
|
||||
PropDef,
|
||||
hasDocgen,
|
||||
@ -30,7 +30,7 @@ function getPropDefs(component: Component, section: string): PropDef[] {
|
||||
|
||||
// eslint-disable-next-line react/forbid-foreign-prop-types
|
||||
if (!hasDocgen(component) && !component.propTypes) {
|
||||
if (isForwardRef(component) || component.render) {
|
||||
if (component.render) {
|
||||
processedComponent = component.render({}).type;
|
||||
}
|
||||
if (isMemo(component)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user