retech-tsx-snippet
Features
rtd - react retech template
import { useEffect, useState } from 'react';
import { useRequest } from 'ahooks';
import { useHistory } from 'umi';
import { Button, Card, Col, Row, Select, Tabs, Typography, notification } from '@retech/ui';
import Icon, * as Icons from '@retech/icons';
import styles from './index.less';
interface testProps {
[key: string]: any;
}
const test: React.FC<testProps> = (props) => {
const [data, setData] = useState('');
useEffect(() => {
}, [])
return (<>
</>)
}
export default test;
usq - ahooks useRequest
// get xxx
const { run: runxxx } = useRequest(APIs.xxx, {
manual: true,
onSuccess: ({ data, code, message }) => {
if (code === 0) {
if (!message) {
} else {
notification.warning({ message });
}
} else {
notification.warning({ message });
}
}
});
Enjoy!
| |