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

fix(useAxios): use RawAxiosRequestConfig type #2662

Closed
wants to merge 1 commit into from

Conversation

lalalazero
Copy link

@lalalazero lalalazero commented Jan 19, 2023

Description

Due to Axios type refactor, headers in AxiosRequestConfig is now mandatory,

useAxios would cause typescript error like this

image

this pr is to replace AxiosRequestConfig with RawAxiosRequestConfig as suggested here

Additional context

this refactor is introduced in axios 1.2.3, with 1.2.2 AxiosRequestConfig works fine, I'm not sure how to set this tip

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@laterdayi
Copy link

laterdayi commented Jan 19, 2023

In my opinion, do you not need to upgrade useAxios ,At present, it seems that this is a compatible solution of Axios, and Axios may fix it later

silx-kit/h5web#1353
axios/axios#5476

@lalalazero
Copy link
Author

thanks! I'll downgrade to 1.2.2

@lalalazero lalalazero closed this Jan 19, 2023
@laterdayi
Copy link

laterdayi commented Jan 19, 2023

thanks! I'll downgrade to 1.2.2

Personally, I think the current problems can be solved through demotion, and I think Axios is also looking for a solution. If it is finally determined that AxiosRequestConfig is switched to RawAxiosRequestConfig,I think it would be better to modify useAxios at this point

@lalalazero
Copy link
Author

thanks! I'll downgrade to 1.2.2

Personally, I think the current problems can be solved through demotion, and I think Axios is also looking for a solution. If it is finally determined that AxiosRequestConfig is switched to RawAxiosRequestConfig,I think it would be better to modify useAxios at this point

totally agree, when it's determined I'll reopen this pr. let me have this contribution ;)

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

Successfully merging this pull request may close these issues.

None yet

2 participants