Skip to content

Commit ccf14eb

Browse files
CJY0208liuyib
andauthored
fix(useResponse): adds default export (alibaba#2555)
* fix: useResponse adds default export, aligning export format with other hooks * refactor(useResponsive): use default export --------- Co-authored-by: 云泥 <[email protected]>
1 parent 95e9dbd commit ccf14eb

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

packages/hooks/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import useRafTimeout from './useRafTimeout';
5050
import useReactive from './useReactive';
5151
import useRequest, { clearCache } from './useRequest';
5252
import useResetState from './useResetState';
53-
import { configResponsive, useResponsive } from './useResponsive';
53+
import useResponsive, { configResponsive } from './useResponsive';
5454
import useSafeState from './useSafeState';
5555
import useScroll from './useScroll';
5656
import useSelections from './useSelections';

packages/hooks/src/useResponsive/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { renderHook, act } from '../../utils/tests';
2-
import { useResponsive } from '../';
2+
import useResponsive from '../';
33

44
describe('useResponsive', () => {
55
function changeWidth(width: number) {

packages/hooks/src/useResponsive/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function configResponsive(config: ResponsiveConfig) {
4949
if (info) calculate();
5050
}
5151

52-
export function useResponsive() {
52+
function useResponsive() {
5353
if (isBrowser && !listening) {
5454
info = {};
5555
calculate();
@@ -83,3 +83,5 @@ export function useResponsive() {
8383

8484
return state;
8585
}
86+
87+
export default useResponsive;

0 commit comments

Comments
 (0)