mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
type: supplementary React.FC type (#43410)
* type: supplementary React.FC type * fix: remove useless code * revert: remove useStyle * revert: card-top * Update card-top.tsx
This commit is contained in:
parent
fd8a9884f0
commit
f566e3b24b
@ -1,13 +1,13 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { PoweroffOutlined } from '@ant-design/icons';
|
||||
import { Button, Space } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
const Text1 = () => '部署';
|
||||
const Text2 = () => <span>部署</span>;
|
||||
const Text3 = () => 'Submit';
|
||||
|
||||
const App = () => (
|
||||
const App: React.FC = () => (
|
||||
<Space wrap>
|
||||
<Button loading>部署</Button>
|
||||
<Button loading>
|
||||
|
@ -55,7 +55,7 @@ describe('ColorPicker', () => {
|
||||
});
|
||||
|
||||
it('Should component custom trigger work', async () => {
|
||||
const App = () => {
|
||||
const App: React.FC = () => {
|
||||
const [color, setColor] = useState<Color | string>('hsb(215, 91%, 100%)');
|
||||
const colorString = useMemo(
|
||||
() => (typeof color === 'string' ? color : color.toHsbString()),
|
||||
|
@ -1641,7 +1641,7 @@ describe('Form', () => {
|
||||
<DatePicker.YearPicker key="DatePicker.YearPicker" disabled={disabled} />,
|
||||
<DatePicker.TimePicker key="DatePicker.TimePicker" disabled={disabled} />,
|
||||
];
|
||||
const App = () => <Form disabled>{renderComps(false)}</Form>;
|
||||
const App: React.FC = () => <Form disabled>{renderComps(false)}</Form>;
|
||||
|
||||
const wrapper = render(<App />);
|
||||
expect(wrapper.container.querySelectorAll('[disabled]').length).toBe(0);
|
||||
@ -1803,7 +1803,7 @@ describe('Form', () => {
|
||||
return <Input {...props} />;
|
||||
};
|
||||
|
||||
const App = () => (
|
||||
const App: React.FC = () => (
|
||||
<Form>
|
||||
<Form.Item>
|
||||
<Form.Item name="test" label="test" rules={[{ len: 3, message: 'error.' }]}>
|
||||
|
@ -26,7 +26,7 @@ const SubmitButton = ({ form }: { form: FormInstance }) => {
|
||||
);
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
const App: React.FC = () => {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Image } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
const App = () => (
|
||||
const App: React.FC = () => (
|
||||
<Image.PreviewGroup
|
||||
preview={{ countRender: (current, total) => `当前 ${current} / 总计 ${total}` }}
|
||||
>
|
||||
|
@ -398,7 +398,7 @@ describe('Input allowClear', () => {
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/31927
|
||||
it('should correctly when useState', () => {
|
||||
const App = () => {
|
||||
const App: React.FC = () => {
|
||||
const [query, setQuery] = useState('');
|
||||
return (
|
||||
<Input
|
||||
|
@ -489,7 +489,7 @@ describe('TextArea allowClear', () => {
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/31927
|
||||
it('should correctly when useState', () => {
|
||||
const App = () => {
|
||||
const App: React.FC = () => {
|
||||
const [query, setQuery] = useState('');
|
||||
return (
|
||||
<TextArea
|
||||
|
@ -1472,7 +1472,7 @@ describe('Table.filter', () => {
|
||||
});
|
||||
|
||||
it('filtered should work after change', () => {
|
||||
const App = () => {
|
||||
const App: React.FC = () => {
|
||||
const [filtered, setFiltered] = React.useState(true);
|
||||
const columns = [
|
||||
{
|
||||
|
@ -1,14 +1,14 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Tag } from 'antd';
|
||||
import { DndContext, PointerSensor, useSensor, useSensors, closestCenter } from '@dnd-kit/core';
|
||||
import {
|
||||
arrayMove,
|
||||
useSortable,
|
||||
SortableContext,
|
||||
horizontalListSortingStrategy,
|
||||
} from '@dnd-kit/sortable';
|
||||
import type { FC } from 'react';
|
||||
import { DndContext, PointerSensor, closestCenter, useSensor, useSensors } from '@dnd-kit/core';
|
||||
import type { DragEndEvent } from '@dnd-kit/core/dist/types/index';
|
||||
import {
|
||||
SortableContext,
|
||||
arrayMove,
|
||||
horizontalListSortingStrategy,
|
||||
useSortable,
|
||||
} from '@dnd-kit/sortable';
|
||||
import { Tag } from 'antd';
|
||||
import type { FC } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
|
||||
type Item = {
|
||||
id: number;
|
||||
@ -43,7 +43,7 @@ const DraggableTag: FC<DraggableTagProps> = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
const App: React.FC = () => {
|
||||
const [items, setItems] = useState<Item[]>([
|
||||
{
|
||||
id: 1,
|
||||
|
@ -646,7 +646,7 @@ describe('Transfer', () => {
|
||||
it('control mode select all should not throw warning', () => {
|
||||
const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
|
||||
const App = () => {
|
||||
const App: React.FC = () => {
|
||||
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
|
||||
|
||||
const onSelectChange = (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => {
|
||||
@ -686,7 +686,7 @@ describe('immutable data', () => {
|
||||
});
|
||||
|
||||
it('prevent error when reset data in some cases', () => {
|
||||
const App = () => {
|
||||
const App: React.FC = () => {
|
||||
const [mockData, setMockData] = useState<DefaultRecordType[]>([]);
|
||||
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user