2016-08-22 2 views
1

다음 코드로 Appbar의 오른쪽에 사용자 이름과 암호에 대한 두 개의 텍스트 입력 필드를 삽입하려고합니다. 그러나 그것은 어떤 결과도주지 않는다.Appbar 내부 재질 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

이것은 테스트되었으며 절대로 작동합니다. 시도 해봐. –

관련 문제