mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 19:42:54 +08:00
22 lines
495 B
TypeScript
22 lines
495 B
TypeScript
import * as React from 'react';
|
|
|
|
import { FormItemPopupContext } from '../context';
|
|
|
|
interface PopupProviderProps {
|
|
children?: React.ReactNode;
|
|
}
|
|
|
|
export default function PopupProvider({ children }: PopupProviderProps) {
|
|
const [popupOpen, setPopupOpen] = React.useState(false);
|
|
|
|
const value = React.useMemo(
|
|
() => ({
|
|
popupOpen,
|
|
setPopupOpen,
|
|
}),
|
|
[popupOpen],
|
|
);
|
|
|
|
return <FormItemPopupContext.Provider value={value}>{children}</FormItemPopupContext.Provider>;
|
|
}
|