Skip to content

[EuiFlyout] Fix prop table; refactor - #5011

Merged
thompsongl merged 1 commit into
elastic:masterfrom
thompsongl:4980-flyout
Aug 31, 2021
Merged

thompsongl merged 1 commit into
elastic:masterfrom
thompsongl:4980-flyout

Conversation

@thompsongl

@thompsongl thompsongl commented Aug 9, 2021 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #4980. Changes include exporting EuiFlyout from the definition location, and some clean up work to standardize React type imports.

### Checklist

@kibanamachine

Copy link
Copy Markdown
Contributor

@thompsongl thompsongl added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Aug 10, 2021
@thompsongl
thompsongl marked this pull request as ready for review August 10, 2021 14:33
@cchaos

cchaos commented Aug 23, 2021

Copy link
Copy Markdown
Contributor

👍 The Flyout props table is displaying without error now, but it seems the default values are not showing up.

@thompsongl

Copy link
Copy Markdown
Contributor Author

I haven't been able to get react-docgen-typescript to find the default values. The forwardRef + TypeScript generic problem and workaround (described here) that we've had to do either leaves us with insufficient type safety for consumers or insufficient documentation.
We could add the default values to the prop comments using the jsdoc tag, which react-docgen-typescript understands.
I could also merge this as-is so the table is not entirely broken and open an issue to try to solve the problem more generally. I don't have much in the way of ideas currently.

@cee-chen

Copy link
Copy Markdown
Contributor

I'm definitely biased as a dev who primarily interacted with EUI's docs from the props tab and would generally immediately jump to it to get the info I wanted, but I would personally vote for using the @jsdoc tag even if it's a bit more redundant (and for my own knowledge - perhaps a quick top level comment as to why this component requires it when other components don't)

@chandlerprall chandlerprall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; makes sense to merge then and continue looking into how we can find those default prop values.

@thompsongl

Copy link
Copy Markdown
Contributor Author

Merging this as-is to fix the render-blocking error. We can follow-up with a more general solution to fixing the default values: #5118

@thompsongl
thompsongl merged commit 0384496 into elastic:master Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiFlyout] Documentation broken for EuiFlyout "props" tab

5 participants