我尝试下载Material UI的一个示例并尝试文本字段。该示例中的其他组件工作得很好(例如Dialogue,Button)。在TextField上,defaultValue是我尝试过的唯一有效的道具。谢谢你的帮助。
我一直收到错误:
警告:标记上的未知道具floatingLabelText
,floatingLabelFixed
,import React, { Component } from 'react';
import PropTypes from 'prop-types';
import TextField from 'material-ui/TextField'
import withStyles from 'material-ui/styles/withStyles';
import withRoot from '../components/withRoot';
const styles = {
root: {
textAlign: 'center',
paddingTop: 200,
},
};
let hint = "I wish this would work.";
class Index extends Component {
render() {
return (
<div>
<TextField
hintText={hint}
floatingLabelText="Floating Label Text"
floatingLabelFixed={true}
/>
</div>
);
}
}
Index.propTypes = {
classes: PropTypes.object.isRequired,
};
export default withRoot(withStyles(styles)(Index));
。
Returns the number of characters of the specified string expression, excluding trailing blanks.
答案 0 :(得分:0)
这是使用“版本”:“1.0.0-beta.11”
我切换到最新的稳定构建,一切正常!