2016-08-22 20 views
1

次のコードでAppbarの右側にユーザ​​ー名とパスワードの2つのテキスト入力フィールドを挿入しようとしています。しかし、それは何の出力も与えません。Appbar内のUI UIテキスト入力フィールドが機能しない

const AppBarExampleIconMenu =() => (< AppBar title = { < span style = { styles.title } > Test < /span>} 
      iconElementLeft = { <IconButton> < NavigationClose/> < /IconButton>} 
       iconElementRight = { <div> 
        < TextField 
        hintText = "UserName"/> 
        < TextField 
        hintText = "PassWord"/> 
        < /div> 
       } 

       /> 
      ); 

答えて

2

今すぐお試しください。これはテスト済みで実証済みです。これはES6スタイルで書かれています。

class Test extends React.Component { 
    constructor(props) { 
     super(props); 
    } 

    render() { 
     return (
      <MuiThemeProvider> 
       <AppBar 
        title={"Title"} 
        iconElementLeft={<IconButton iconClassName="muidocs-icon-custom-github" />} 
        iconElementRight={ 
         <div> 
          <TextField 
           hintText="Username" 
          /> 
          <TextField 
           hintText="Password" 
          /> 
         </div> 
        } 
       /> 

      </MuiThemeProvider> 
     ) 
    } 
} 
+0

これはうまくいかなかった。 –

+0

私は私の答えを編集しました。 –

+0

これはテストされており、絶対に動作しています。それを試してみてください。 –

関連する問題