import React from "react"; import styles from "./index.less"; import { Modal, Button } from "antd"; const ReachableContext = React.createContext(); const UnreachableContext = React.createContext(); const config = { title: "Use Hook!", content: (
{name => `Reachable: ${name}!`}
{name => `Unreachable: ${name}!`}
) }; const App = () => { const [modal, contextHolder] = Modal.useModal(); return ( {/* `contextHolder` should always under the context you want to access */} {contextHolder} {/* Can not access this context since `contextHolder` is not in it */} ); }; export default () => (
);