Skip to content

Commit

Permalink
fix(useUnmountedRef): docs typo (alibaba#1473)
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsbhqt authored Feb 24, 2022
1 parent cbc8f8f commit 58fd63f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/hooks/src/useUnmountedRef/demo/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/**
* title: Default usage
* desc: unmountefRef.current means whether the component is unmounted
* desc: unmountedRef.current means whether the component is unmounted
*
* title.zh-CN: 基础用法
* desc.zh-CN: unmountefRef.current 代表组件是否已经卸载
* desc.zh-CN: unmountedRef.current 代表组件是否已经卸载
*/

import { useBoolean, useUnmountedRef } from 'ahooks';
import { message } from 'antd';
import React, { useEffect } from 'react';

const MyComponent = () => {
const unmountefRef = useUnmountedRef();
const unmountedRef = useUnmountedRef();
useEffect(() => {
setTimeout(() => {
if (!unmountefRef.current) {
if (!unmountedRef.current) {
message.info('component is alive');
}
}, 3000);
Expand Down

0 comments on commit 58fd63f

Please sign in to comment.