์ ๋ ReactJS์ Material-Ui๋ฅผ ์ฌ์ฉํ์ฌ ํ ์คํธํ๊ณ ์์ต๋๋ค. ์์ ํ ์คํธ ๊ตฌ์ฑ ์์์ ๊ฒฝ์ฐ ๋ํ ์์๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค. ๊ทํ์ ์์ ์ ๋์ผํ ์ฝ๋๋ฅผ ์ฌ์ฉํ๊ณ ์์ง๋ง ์๋ํ์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ฒ๊ทธ๊ฐ ์๊ฑฐ๋ ๋ฌธ์๊ฐ ์ถฉ๋ถํ ๋ช ํํ์ง ์์์ ์ ์์ต๋๋ค.
์ฝ๋๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
const {Dialog, FlatButton} = MUI;
Home = React.createClass({
getInitialState() {
return {
welcomeModal: false
};
},
openWelcomeDialog() {
this.setState({welcomeModal:true});
},
closeWelcomeDialog(buttonClicked) {
console.log('Close The Welcome Dialog.');
this.setState({welcomeModal:false});
},
render() {
let modalActions = [
{ text: 'Cancel' }
];
return (
<div>
<h1>Welcome to my app</h1>
<a href="#" onClick={this.openWelcomeDialog}>Open the Welcome Modal</a>
<Dialog
title="Welcome Modal"
actions={modalActions}
autoDetectWindowHeight={true}
autoScrollBodyContent={true}
open={this.state.welcomeModal}
onRequestClose={this.closeWelcomeDialog}>
<div style={{height: '1000px'}}>
Really long content
</div>
</Dialog>
</div>
);
}
});
๋ฌด์จ ์ผ์ด์ผ:
๋งํฌ๋ฅผ ํด๋ฆญํ๋ฉด ์ด๋ฒคํธ๊ฐ ์์๋๊ณ ๋ชจ๋ฌ์ด ์ฌ๋ฐ๋ฅธ ๋ฐฉ์์ผ๋ก ์ด๋ฆฝ๋๋ค. ํ์ง๋ง: ๋ฐฑ๊ทธ๋ผ์ด๋์์ ๋๋ ์ทจ์ ๋ฒํผ์์ ํด๋ฆญํ๋ ๊ฒ์ ์ค์ํ์ง ์์ต๋๋ค. ๋ชจ๋ฌ์ด ๋ซํ์ง ์๊ณ console.log๋ ์คํ๋์ง ์์ต๋๋ค... ๊ทธ๋์: ๋ฉ์๋๊ฐ ํธ์ถ๋์ง ์์ต๋๋ค! ๋ด ์์์๋ ๋ชจ๋ฌ์ ๋ซ๋ ๊ฒ์ด ๋ถ๊ฐ๋ฅํฉ๋๋ค.
๋จผ์ injectTapEventPlugin()
๋ฅผ) ํธ์ถํ๊ณ ์์ต๋๊น?
์ค .. '๋ฆฌ ? ์ด์ ์๋ํฉ๋๋ค. ๋๋ ์ ์ ๋์ ๋ฌธ์ ๋ฅผ ์ฐพ์ผ๋ ค๊ณ ๋ ธ๋ ฅํ์ต๋๋ค ...
๊ทธ๋์ ๋๋ต์: ์๋์, ๋๋ ๊ทธ๊ฒ์ ๋ถ๋ฅธ ๊ฒ์ด ์๋๋๋ค. Material-Ui Docs์์ ์ด๊ฒ์ ์ฐธ์กฐํ์ง ์์์ต๋๋ค. @oliviertassinari ๊ฐ์ฌ
๋๋ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์ผ๋ฉฐ injectTapEventPlugin()
์์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ์ด๋ฒคํธ์ ๊ด๋ จ๋ ๋ค๋ฅธ ๋ชจ๋ ๊ฒ์ด ์๋ํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ค๋ฅธ ๊ฒ์ ํ์ธํด์ผ ํฉ๋๊น?
๋ฌธ์ ๋ ์ด๋๋ฅผ ํด๋ฆญํ๋ ์์ ํญ๋ชฉ๊ณผ ๊ฑฐ์ ๋์ผํฉ๋๋ค. ์คํ๋์ง ์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋๋ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์ผ๋ฉฐ
injectTapEventPlugin()
์์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ์ด๋ฒคํธ์ ๊ด๋ จ๋ ๋ค๋ฅธ ๋ชจ๋ ๊ฒ์ด ์๋ํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ค๋ฅธ ๊ฒ์ ํ์ธํด์ผ ํฉ๋๊น?๋ฌธ์ ๋ ์ด๋๋ฅผ ํด๋ฆญํ๋ ์์ ํญ๋ชฉ๊ณผ ๊ฑฐ์ ๋์ผํฉ๋๋ค. ์คํ๋์ง ์์ต๋๋ค.