You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1.2 KiB

id title layout permalink prev next
use-react-with-other-libraries-ko-KR React와 다른 라이브러리를 함께 사용하기 tips use-react-with-other-libraries-ko-KR.html children-undefined-ko-KR.html dangerously-set-inner-html-ko-KR.html

React만으로 만들 필요는 없습니다. 컴포넌트의 생명주기 이벤트, 특히 componentDidMountcomponentDidUpdate는 다른 라이브러리들의 로직을 넣기에 좋은 장소입니다.

var App = React.createClass({
  getInitialState: function() {
    return {myModel: new myBackboneModel({items: [1, 2, 3]})};
  },

  componentDidMount: function() {
    $(this.refs.placeholder).append($('<span />'));
  },

  componentWillUnmount: function() {
    // 정리는 여기서 합니다
  },

  shouldComponentUpdate: function() {
    // 이 컴포넌트를 다시는 업데이트하지 않도록 하죠.
    return false;
  },

  render: function() {
    return <div ref="placeholder"/>;
  }
});

ReactDOM.render(<App />, mountNode);

이 방식으로 별도의 이벤트 리스너이벤트 스트림 같은 것들을 더할 수 있습니다.