有没有办法在外部文件中定义useSelector <TRootState, string>,并在元件文件中直接应用它?外部文件: export type TUser = <TRootState, string> // not working 组件的文件: import { TUser } from "./pathToFile"
const user = useSelect
我正在将typeScript添加到react/redux项目中。我无法加载我的应用程序,因为我收到错误:在index.tsx中,我组合了还原器并定义了类型状态:export type State = ReturnType<typeof allReducers>;
下面是我试图使用状态的文件import <