Skip to content

feat(typescript): add private modifier for private methods #409

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

Merged
merged 2 commits into from
Jan 5, 2020

Conversation

satya164
Copy link
Member

When generating documentation for methods in class components using TypeScript, I have some methods marked as private because they are internal and don't want to show them in the docs. But I don't have any information regarding whether a method is public or private in the currently extracted metadata. In this PR, I'm adding a modifier for private methods so I can know which methods to exclude.

@danez
Copy link
Collaborator

danez commented Dec 12, 2019

Thanks. I was just thinking we probably can do the same for private methods in javascript but what react-docgen is actually doing is documenting the API if a react component, so props and (public) methods. I even think we probably shouldn't even include private methods.
I guess that would work for you too?

@satya164
Copy link
Member Author

satya164 commented Dec 12, 2019

@danez: I even think we probably shouldn't even include private methods. I guess that would work for you too?

It works for me. Should I update the PR to filter out private methods?

@danez
Copy link
Collaborator

danez commented Dec 13, 2019

It works for me. Should I update the PR to filter out private methods?

yes please

@danez danez merged commit ea7d203 into reactjs:master Jan 5, 2020
@danez
Copy link
Collaborator

danez commented Jan 5, 2020

Thank you, I made the change to skip private methods. It will be in the next version.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants