Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon-docs: React forwardRef breaks Props block #7933

Closed
magicspon opened this issue Aug 30, 2019 · 5 comments
Closed

Addon-docs: React forwardRef breaks Props block #7933

magicspon opened this issue Aug 30, 2019 · 5 comments

Comments

@magicspon
Copy link

magicspon commented Aug 30, 2019

Ref: #4961

To Reproduce
component:

import React from 'react'
import { string } from 'prop-types'

const Title = React.forwardRef((props, ref) => (
  return <div ref={ref}>{prop.text}</div>
))

Title.propTypes = { 
  text: string.isRequired
}

export default Title

story:

import React from 'react'
import Title from './Title'

export default {
	title: 'Example|Title',
	parameters: {
		component: Title
	}
}

export const newUser = () => <Title text="Ted Doe"  />

Expected behavior
The props table should show props.text is of type string

Screenshots
image

System:
System:
OS: macOS 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
Binaries:
Node: 12.6.0 - ~/.nvm/versions/node/v12.6.0/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.11.2 - ~/.nvm/versions/node/v12.6.0/bin/npm
Browsers:
Chrome: 76.0.3809.132
Firefox: 68.0.2
Safari: 12.1.2
npmPackages:
@storybook/addon-a11y: ^5.2.0-rc.0 => 5.2.0-rc.0
@storybook/addon-actions: ^5.2.0-rc.0 => 5.2.0-rc.0
@storybook/addon-docs: ^5.2.0-rc.0 => 5.2.0-rc.0
@storybook/addon-knobs: ^5.2.0-rc.0 => 5.2.0-rc.0
@storybook/addon-storysource: ^5.2.0-rc.0 => 5.2.0-rc.0
@storybook/addons: ^5.2.0-rc.0 => 5.2.0-rc.0
@storybook/react: ^5.2.0-rc.0 => 5.2.0-rc.0
@storybook/source-loader: ^5.2.0-rc.0 => 5.2.0-rc.0

@shilman shilman added this to the 5.2.0 milestone Aug 31, 2019
@shilman shilman changed the title forwardRef components: prop types not appearing in table. Addon-docs: React forwardRef breaks Props block Aug 31, 2019
@stale
Copy link

stale bot commented Sep 21, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@darmawanalbert
Copy link
Contributor

@shilman I'm trying to fix this issue 🙇

@magicspon
Copy link
Author

magicspon commented Oct 16, 2019

@darmawanalbert the same applies to memo(Component)

@shilman
Copy link
Member

shilman commented Oct 19, 2019

Huzzah!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.23 containing PR #8445 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Oct 19, 2019
@shilman
Copy link
Member

shilman commented Oct 22, 2019

Jeepers creepers!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.5 containing PR #8445 that references this issue. Upgrade today to try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants