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

React useCallback dependency array not covered #15

Open
davidKCyl opened this issue Feb 6, 2024 · 0 comments
Open

React useCallback dependency array not covered #15

davidKCyl opened this issue Feb 6, 2024 · 0 comments

Comments

@davidKCyl
Copy link

Everything else is covered and working perfectly, however I've noticed that a custom React hook using two useCallbacks has both dependency arrays uncovered. The function containing the calls is being called, which would make me expect them to be covered.

For example:

const getThing = useCallback(() => {
  return client
    .get('/some-url')
    .then(res => res.json());
}, [client]);

has , [client] covered, whereas with the following it's not covered:

const getThing = useCallback(() => {
  return client
    .use()
    .get('/some-url')
    .then(res => res.json());
}, [client]);

I'm not suggesting there is an issue with this project - to rule that out, how should I go about finding the cause of this?

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

1 participant