Skip to content

Commit

Permalink
refactor: remove export SenderRef and use GetRef instead
Browse files Browse the repository at this point in the history
  • Loading branch information
YumoImer committed Dec 24, 2024
1 parent 5f40faf commit 1488aa8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions components/attachments/demo/with-sender.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CloudUploadOutlined, LinkOutlined } from '@ant-design/icons';
import { Attachments, AttachmentsProps, Sender, type SenderRef } from '@ant-design/x';
import { App, Badge, Button, Flex, type GetProp, Typography } from 'antd';
import { Attachments, AttachmentsProps, Sender } from '@ant-design/x';
import { App, Badge, Button, Flex, type GetProp, type GetRef, Typography } from 'antd';
import React from 'react';

const Demo = () => {
Expand All @@ -10,7 +10,7 @@ const Demo = () => {

const { notification } = App.useApp();

const senderRef = React.useRef<SenderRef>(null);
const senderRef = React.useRef<GetRef<typeof Sender>>(null);

const senderHeader = (
<Sender.Header
Expand Down
2 changes: 1 addition & 1 deletion components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export { default as Attachments } from './attachments';
export type { AttachmentsProps } from './attachments';

export { default as Sender } from './sender';
export type { SenderProps, SenderRef } from './sender';
export type { SenderProps } from './sender';

export { default as Bubble } from './bubble';
export type { BubbleProps } from './bubble';
Expand Down
6 changes: 2 additions & 4 deletions components/sender/demo/focus.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Sender } from '@ant-design/x';
import { Button, Flex } from 'antd';
import { Button, Flex, type GetRef } from 'antd';
import React, { useRef } from 'react';

import type { SenderRef } from '@ant-design/x';

const App: React.FC = () => {
const senderRef = useRef<SenderRef>(null);
const senderRef = useRef<GetRef<typeof Sender>>(null);

const senderProps = {
defaultValue: 'Hello, welcome to use Ant Design X!',
Expand Down
4 changes: 2 additions & 2 deletions components/sender/demo/paste-image.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CloudUploadOutlined, LinkOutlined } from '@ant-design/icons';
import { Attachments, AttachmentsProps, Sender, type SenderRef } from '@ant-design/x';
import { Attachments, AttachmentsProps, Sender } from '@ant-design/x';
import { App, Button, Flex, type GetProp, type GetRef } from 'antd';
import React from 'react';

Expand All @@ -10,7 +10,7 @@ const Demo = () => {

const attachmentsRef = React.useRef<GetRef<typeof Attachments>>(null);

const senderRef = React.useRef<SenderRef>(null);
const senderRef = React.useRef<GetRef<typeof Sender>>(null);

const senderHeader = (
<Sender.Header
Expand Down

0 comments on commit 1488aa8

Please sign in to comment.