define interface:
export interface INav { nav: string } export interface IModuleItem { state?: string; type?: string; uri?: string; }
use in Function Component:
import {INav} from "./path/to/menu.ts"; const AppNavigator = (props: INav & RouteComponentProps) => { const [currentNav, setCurrentNav] = useState<INav>(props.nav); .... } export default withRouter(AppNavigator);
原文地址:https://www.cnblogs.com/Nyan-Workflow-FC/p/11240695.html
时间: 2024-10-06 21:18:04