hooks icon indicating copy to clipboard operation
hooks copied to clipboard

feat: useRequest support params

Open crazyair opened this issue 1 year ago • 2 comments

[中文版模板 / Chinese template]

🤔 This is a ...

  • [x] New feature
  • [ ] Bug fix
  • [ ] Site / documentation update
  • [ ] Demo update
  • [ ] TypeScript definition update
  • [ ] Bundle size optimization
  • [ ] Performance optimization
  • [ ] Enhancement feature
  • [ ] Internationalization
  • [ ] Refactoring
  • [ ] Code style optimization
  • [ ] Test Case
  • [ ] Branch merge
  • [ ] Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English useRequest support params
🇨🇳 Chinese useRequest 支持 params

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • [x] Doc is updated/provided or not needed
  • [x] Demo is updated/provided or not needed
  • [x] TypeScript definition is updated/provided or not needed
  • [x] Changelog is provided or not needed

crazyair avatar Dec 02 '24 01:12 crazyair

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 02 '24 01:12 CLAassistant

defaultParams 只能这样写

image

支持后就可以这样写

    const [userId, setUserId] = useState('1');
    const { data } = useRequest(getUserSchool, {
        params: [userId],
        refreshDeps: [userId],
    });

crazyair avatar Dec 02 '24 01:12 crazyair