Skip to content

Commit

Permalink
fix(useResponse): adds default export (alibaba#2555)
Browse files Browse the repository at this point in the history
* fix: useResponse adds default export, aligning export format with other hooks

* refactor(useResponsive): use default export

---------

Co-authored-by: 云泥 <[email protected]>
  • Loading branch information
CJY0208 and liuyib authored May 27, 2024
1 parent 95e9dbd commit ccf14eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/hooks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import useRafTimeout from './useRafTimeout';
import useReactive from './useReactive';
import useRequest, { clearCache } from './useRequest';
import useResetState from './useResetState';
import { configResponsive, useResponsive } from './useResponsive';
import useResponsive, { configResponsive } from './useResponsive';
import useSafeState from './useSafeState';
import useScroll from './useScroll';
import useSelections from './useSelections';
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useResponsive/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { renderHook, act } from '../../utils/tests';
import { useResponsive } from '../';
import useResponsive from '../';

describe('useResponsive', () => {
function changeWidth(width: number) {
Expand Down
4 changes: 3 additions & 1 deletion packages/hooks/src/useResponsive/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function configResponsive(config: ResponsiveConfig) {
if (info) calculate();
}

export function useResponsive() {
function useResponsive() {
if (isBrowser && !listening) {
info = {};
calculate();
Expand Down Expand Up @@ -83,3 +83,5 @@ export function useResponsive() {

return state;
}

export default useResponsive;

0 comments on commit ccf14eb

Please sign in to comment.