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

@component useEffect #67

Open
jzrskc opened this issue Mar 27, 2020 · 1 comment
Open

@component useEffect #67

jzrskc opened this issue Mar 27, 2020 · 1 comment

Comments

@jzrskc
Copy link

jzrskc commented Mar 27, 2020

I use @component with react hooks and have all my methods listed under the main component.
How can useEffect here be added together with methods or which tag would be correct to use with useEffect?

@joaocraveiro
Copy link

This uses react-docgen to parse react components and it has no such functionality. There's some debate around it here.

To achieve this I've used the following:

@method useEffect[dependency]
@memberof ComponentName

I use that method "signature" that might look weird because usually there are multiple hooks and it's not very helpful to have a bunch of useEffect methods on the index. I find the dependencies a good way of identifying what the effect is about.

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

No branches or pull requests

2 participants