-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addon-docs: Fix React.forwardedRef/memo props (#8445)
Addon-docs: Fix React.forwardedRef/memo props
- Loading branch information
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
examples/official-storybook/stories/addon-docs/forward-ref.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import DocgenButton from '../../components/DocgenButton'; | ||
|
||
const ForwardedButton = React.forwardRef((props, ref) => <DocgenButton ref={ref} {...props} />); | ||
|
||
export default { | ||
title: 'Addons|Docs/ForwardRef', | ||
component: ForwardedButton, | ||
}; | ||
|
||
export const displaysCorrectly = () => <ForwardedButton>Hello World!</ForwardedButton>; | ||
displaysCorrectly.story = { name: 'Displays forwarded ref components correctly' }; |
12 changes: 12 additions & 0 deletions
12
examples/official-storybook/stories/addon-docs/react-memo.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import DocgenButton from '../../components/DocgenButton'; | ||
|
||
const ButtonWithMemo = React.memo(props => <DocgenButton {...props} />); | ||
|
||
export default { | ||
title: 'Addons|Docs/ButtonWithMemo', | ||
component: ButtonWithMemo, | ||
}; | ||
|
||
export const displaysCorrectly = () => <ButtonWithMemo>Hello World!</ButtonWithMemo>; | ||
displaysCorrectly.story = { name: 'Displays components with memo correctly' }; |
93d9608
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: