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

url 不是string的异常 #93

Closed
fangaofeng opened this issue Mar 15, 2020 · 1 comment
Closed

url 不是string的异常 #93

fangaofeng opened this issue Mar 15, 2020 · 1 comment

Comments

@fangaofeng
Copy link

fangaofeng commented Mar 15, 2020

写为如下方式

import { Link, request ,useRequest} from 'umi';

...
const { data, error, loading } = useRequest({
  url: '/api/changeUsername',
  method: 'post',
});

会抛出url不是string的异常。

**import { useRequest } from '@umijs/hooks';**
const { data, error, loading } = useRequest({
  url: '/api/changeUsername',
  method: 'post',

此种方式没有异常。不知道有没有人处理呢?
umijs下面发现引用了不同版本的use-request,一个是hook,另一直接引用use-request。

@sorrycc
Copy link
Member

sorrycc commented Mar 17, 2020

#97 修复,今天更新。

@sorrycc sorrycc closed this as completed Mar 17, 2020
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