Browse Source

refactor: modify all function types in jsx to `React.FC` (#9298)

pull/9345/head
荆棘Justin 4 years ago
committed by GitHub
parent
commit
3e5903491b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/components/Footer/index.tsx
  2. 2
      src/components/NoticeIcon/index.tsx
  3. 4
      src/pages/Admin.tsx
  4. 4
      src/pages/Welcome.tsx

4
src/components/Footer/index.tsx

@ -2,7 +2,7 @@ import { useIntl } from 'umi';
import { GithubOutlined } from '@ant-design/icons';
import { DefaultFooter } from '@ant-design/pro-layout';
export default () => {
const Footer: React.FC = () => {
const intl = useIntl();
const defaultMessage = intl.formatMessage({
id: 'app.copyright.produced',
@ -37,3 +37,5 @@ export default () => {
/>
);
};
export default Footer;

2
src/components/NoticeIcon/index.tsx

@ -70,7 +70,7 @@ const getUnreadData = (noticeData: Record<string, API.NoticeIconItem[]>) => {
return unreadMsg;
};
const NoticeIconView = () => {
const NoticeIconView: React.FC = () => {
const { initialState } = useModel('@@initialState');
const { currentUser } = initialState || {};
const [notices, setNotices] = useState<API.NoticeIconItem[]>([]);

4
src/pages/Admin.tsx

@ -4,7 +4,7 @@ import { Card, Typography, Alert } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { useIntl } from 'umi';
export default (): React.ReactNode => {
const Admin: React.FC = () => {
const intl = useIntl();
return (
<PageHeaderWrapper
@ -41,3 +41,5 @@ export default (): React.ReactNode => {
</PageHeaderWrapper>
);
};
export default Admin;

4
src/pages/Welcome.tsx

@ -12,7 +12,7 @@ const CodePreview: React.FC = ({ children }) => (
</pre>
);
export default (): React.ReactNode => {
const Welcome: React.FC = () => {
const intl = useIntl();
return (
<PageContainer>
@ -61,3 +61,5 @@ export default (): React.ReactNode => {
</PageContainer>
);
};
export default Welcome;

Loading…
Cancel
Save