1 2 3 4
// 全局共享数据示例 import { useState } from 'react'; const useOpenModal = () => {
5
const [openCount, setOpenCount] = useState(0);
6 7 8 9 10 11 12
return { openCount, setOpenCount, }; }; export default useOpenModal;