【发布时间】:2018-10-09 00:31:43
【问题描述】:
我无法弄清楚为什么此导入或任何其他方法不起作用:
import * as React from 'react';
import TextField from '@material-ui/core/TextField';
import * as PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
//import { PropTypes } from '@material-ui/core';
interface IProps {
value: string;
onChange?: PropTypes.func;
}
const textField = (props: IProps) => {
return (
<div>HI</div>
);
};
export default textField;
我收到的错误是:
ts-app/node_modules/@types/prop-types/index"' 没有导出成员 'func'
我正在查看这个文件,它似乎显然有这样一个成员:
export const func: Requireable<(...args: any[]) => any>;
也许有一天我会了解 React 以及这些依赖项是如何工作的,谢谢!
【问题讨论】:
标签: reactjs typescript material-ui react-proptypes