mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
type(mentions): export interface MentionsProps (#49281)
* type(mentions): export interface MentionsProps * type: fix
This commit is contained in:
@@ -85,7 +85,7 @@ export type { LayoutProps, SiderProps } from './layout';
|
||||
export { default as List } from './list';
|
||||
export type { ListProps } from './list';
|
||||
export { default as Mentions } from './mentions';
|
||||
export type { MentionProps } from './mentions';
|
||||
export type { MentionProps, MentionsProps } from './mentions';
|
||||
export { default as Menu } from './menu';
|
||||
export type { MenuItemProps, MenuProps, MenuRef, MenuTheme, SubMenuProps } from './menu';
|
||||
export { default as message } from './message';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Mentions } from 'antd';
|
||||
import type { MentionProps } from 'antd';
|
||||
import type { MentionsProps } from 'antd';
|
||||
|
||||
const MOCK_DATA = {
|
||||
'@': ['afc163', 'zombiej', 'yesmeck'],
|
||||
@@ -12,7 +12,7 @@ type PrefixType = keyof typeof MOCK_DATA;
|
||||
const App: React.FC = () => {
|
||||
const [prefix, setPrefix] = useState<PrefixType>('@');
|
||||
|
||||
const onSearch: MentionProps['onSearch'] = (_, newPrefix) => {
|
||||
const onSearch: MentionsProps['onSearch'] = (_, newPrefix) => {
|
||||
setPrefix(newPrefix as PrefixType);
|
||||
};
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@ export interface MentionProps extends Omit<RcMentionsProps, 'suffix'> {
|
||||
variant?: Variant;
|
||||
}
|
||||
|
||||
export interface MentionsProps extends MentionProps {}
|
||||
|
||||
export interface MentionsRef extends RcMentionsRef {}
|
||||
|
||||
interface MentionsConfig {
|
||||
|
||||
Reference in New Issue
Block a user