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

Still an issue with both executeGet and execute methods when executed manually #992

Closed
spogulis opened this issue Jul 21, 2022 · 4 comments

Comments

@spogulis
Copy link

Still an issue with both executeGet and execute methods returned by:

import { makeUseAxios } from 'axios-hooks'

const baseUrl = 'some api base url'
const url = 'some api get endpoint'

const createAxios = makeUseAxios({
  axios: axios.create({ baseURL: baseUrl })
})

const config: AxiosRequestConfig = {
    method,
    url: baseUrl + url,
    headers: {
      authorization: token ? 'Bearer ' + token : ''
    }
 }

const [{ data, loading, error }, execute] = createAxios(
    config,
    { manual: true }
)

Strangely post method works just fine whereas binding executeGet to onClick of a Button element does nothing.

Originally posted by @spogulis in #82 (comment)

@simoneb
Copy link
Owner

simoneb commented Jul 21, 2022

Please provide a repro, I already posted in the original issue an example showing that it works.

@spogulis
Copy link
Author

The repro you posted is not available.

Please provide a repro, I already posted in the original issue an example showing that it works.

@simoneb
Copy link
Owner

simoneb commented Jul 23, 2022

Here's the repro. Note though that since you are reporting an issue, you are expected to provide a repro.

https://codesandbox.io/s/issue-82-repro-v0z6d6?file=/src/index.js

@spogulis
Copy link
Author

Thank you.

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