정리(clean-up)를 이용하는 Effects

이재협·2022년 5월 13일
0

[ 기능구현 부시기 ]

목록 보기
13/14

https://ko.reactjs.org/docs/hooks-effect.html


  useEffect(() => {
    const channelIo = document.getElementById('ch-plugin');
    channelIo?.setAttribute('style', 'display: none');

    return () => {
      channelIo?.setAttribute('style', 'display: block;');
    };
  }, []);
profile
코딩만을 잘하는 개발자가 아닌 문제를 해결하는 개발자가 되어보자

0개의 댓글

관련 채용 정보